Rename tests to conform with class names.
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
add_subdirectory(common)
|
||||
|
||||
set(TESTS
|
||||
TestQFilesystemHandler
|
||||
TestQHttpBasicAuth
|
||||
TestQHttpHandler
|
||||
TestQHttpMiddleware
|
||||
TestQHttpParser
|
||||
TestQHttpRange
|
||||
TestQHttpServer
|
||||
TestQHttpSocket
|
||||
TestQIByteArray
|
||||
TestBasicAuthMiddleware
|
||||
TestFilesystemHandler
|
||||
TestHandler
|
||||
TestIByteArray
|
||||
TestLocalAuthMiddleware
|
||||
TestLocalFile
|
||||
TestMiddleware
|
||||
TestParser
|
||||
TestProxyHandler
|
||||
TestQIODeviceCopier
|
||||
TestQLocalAuth
|
||||
TestQLocalFile
|
||||
TestQObjectHandler
|
||||
TestQProxyHandler
|
||||
TestRange
|
||||
TestServer
|
||||
TestSocket
|
||||
)
|
||||
|
||||
qt5_add_resources(QRC resource.qrc)
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
const QString Username = "username";
|
||||
const QString Password = "password";
|
||||
|
||||
class TestQHttpBasicAuth : public QObject
|
||||
class TestBasicAuthMiddleware : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
TestQHttpBasicAuth() : auth("Test") {}
|
||||
TestBasicAuthMiddleware() : auth("Test") {}
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
@@ -52,12 +52,12 @@ private:
|
||||
QHttpEngine::BasicAuthMiddleware auth;
|
||||
};
|
||||
|
||||
void TestQHttpBasicAuth::initTestCase()
|
||||
void TestBasicAuthMiddleware::initTestCase()
|
||||
{
|
||||
auth.add(Username, Password);
|
||||
}
|
||||
|
||||
void TestQHttpBasicAuth::testProcess_data()
|
||||
void TestBasicAuthMiddleware::testProcess_data()
|
||||
{
|
||||
QTest::addColumn<bool>("header");
|
||||
QTest::addColumn<QString>("username");
|
||||
@@ -83,7 +83,7 @@ void TestQHttpBasicAuth::testProcess_data()
|
||||
<< static_cast<int>(QHttpEngine::Socket::NotFound);
|
||||
}
|
||||
|
||||
void TestQHttpBasicAuth::testProcess()
|
||||
void TestBasicAuthMiddleware::testProcess()
|
||||
{
|
||||
QFETCH(bool, header);
|
||||
QFETCH(QString, username);
|
||||
@@ -115,5 +115,5 @@ void TestQHttpBasicAuth::testProcess()
|
||||
QTRY_COMPARE(client.statusCode(), status);
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQHttpBasicAuth)
|
||||
#include "TestQHttpBasicAuth.moc"
|
||||
QTEST_MAIN(TestBasicAuthMiddleware)
|
||||
#include "TestBasicAuthMiddleware.moc"
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
const QByteArray Data = "test";
|
||||
|
||||
class TestQFilesystemHandler : public QObject
|
||||
class TestFilesystemHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -57,14 +57,14 @@ private:
|
||||
QTemporaryDir dir;
|
||||
};
|
||||
|
||||
void TestQFilesystemHandler::initTestCase()
|
||||
void TestFilesystemHandler::initTestCase()
|
||||
{
|
||||
QVERIFY(createFile("outside"));
|
||||
QVERIFY(createDirectory("root"));
|
||||
QVERIFY(createFile("root/inside"));
|
||||
}
|
||||
|
||||
void TestQFilesystemHandler::testRequests_data()
|
||||
void TestFilesystemHandler::testRequests_data()
|
||||
{
|
||||
QTest::addColumn<QString>("path");
|
||||
QTest::addColumn<int>("statusCode");
|
||||
@@ -91,7 +91,7 @@ void TestQFilesystemHandler::testRequests_data()
|
||||
<< QByteArray();
|
||||
}
|
||||
|
||||
void TestQFilesystemHandler::testRequests()
|
||||
void TestFilesystemHandler::testRequests()
|
||||
{
|
||||
QFETCH(QString, path);
|
||||
QFETCH(int, statusCode);
|
||||
@@ -114,7 +114,7 @@ void TestQFilesystemHandler::testRequests()
|
||||
}
|
||||
}
|
||||
|
||||
void TestQFilesystemHandler::testRangeRequests_data()
|
||||
void TestFilesystemHandler::testRangeRequests_data()
|
||||
{
|
||||
QTest::addColumn<QString>("path");
|
||||
QTest::addColumn<QString>("range");
|
||||
@@ -159,7 +159,7 @@ void TestQFilesystemHandler::testRangeRequests_data()
|
||||
<< Data;
|
||||
}
|
||||
|
||||
void TestQFilesystemHandler::testRangeRequests()
|
||||
void TestFilesystemHandler::testRangeRequests()
|
||||
{
|
||||
QFETCH(QString, path);
|
||||
QFETCH(QString, range);
|
||||
@@ -193,7 +193,7 @@ void TestQFilesystemHandler::testRangeRequests()
|
||||
}
|
||||
}
|
||||
|
||||
bool TestQFilesystemHandler::createFile(const QString &path)
|
||||
bool TestFilesystemHandler::createFile(const QString &path)
|
||||
{
|
||||
QFile file(QDir(dir.path()).absoluteFilePath(path));
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
@@ -203,10 +203,10 @@ bool TestQFilesystemHandler::createFile(const QString &path)
|
||||
return file.write(Data) == Data.length();
|
||||
}
|
||||
|
||||
bool TestQFilesystemHandler::createDirectory(const QString &path)
|
||||
bool TestFilesystemHandler::createDirectory(const QString &path)
|
||||
{
|
||||
return QDir(dir.path()).mkpath(path);
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQFilesystemHandler)
|
||||
#include "TestQFilesystemHandler.moc"
|
||||
QTEST_MAIN(TestFilesystemHandler)
|
||||
#include "TestFilesystemHandler.moc"
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
QString mPathRemainder;
|
||||
};
|
||||
|
||||
class TestQHttpHandler : public QObject
|
||||
class TestHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -57,7 +57,7 @@ private Q_SLOTS:
|
||||
void testSubHandler();
|
||||
};
|
||||
|
||||
void TestQHttpHandler::testRedirect_data()
|
||||
void TestHandler::testRedirect_data()
|
||||
{
|
||||
QTest::addColumn<QRegExp>("pattern");
|
||||
QTest::addColumn<QString>("destination");
|
||||
@@ -86,7 +86,7 @@ void TestQHttpHandler::testRedirect_data()
|
||||
<< QByteArray("/path/123");
|
||||
}
|
||||
|
||||
void TestQHttpHandler::testRedirect()
|
||||
void TestHandler::testRedirect()
|
||||
{
|
||||
QFETCH(QRegExp, pattern);
|
||||
QFETCH(QString, destination);
|
||||
@@ -114,7 +114,7 @@ void TestQHttpHandler::testRedirect()
|
||||
}
|
||||
}
|
||||
|
||||
void TestQHttpHandler::testSubHandler_data()
|
||||
void TestHandler::testSubHandler_data()
|
||||
{
|
||||
QTest::addColumn<QRegExp>("pattern");
|
||||
QTest::addColumn<QByteArray>("path");
|
||||
@@ -140,7 +140,7 @@ void TestQHttpHandler::testSubHandler_data()
|
||||
<< static_cast<int>(QHttpEngine::Socket::OK);
|
||||
}
|
||||
|
||||
void TestQHttpHandler::testSubHandler()
|
||||
void TestHandler::testSubHandler()
|
||||
{
|
||||
QFETCH(QRegExp, pattern);
|
||||
QFETCH(QByteArray, path);
|
||||
@@ -166,5 +166,5 @@ void TestQHttpHandler::testSubHandler()
|
||||
QCOMPARE(subHandler.mPathRemainder, pathRemainder);
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQHttpHandler)
|
||||
#include "TestQHttpHandler.moc"
|
||||
QTEST_MAIN(TestHandler)
|
||||
#include "TestHandler.moc"
|
||||
@@ -42,7 +42,7 @@ const char *Value2 = "TEST";
|
||||
TEST_OPERATOR(tn, t, LessEqual, <=, true) \
|
||||
TEST_OPERATOR(tn, t, GreaterEqual, >=, true)
|
||||
|
||||
class TestQIByteArray : public QObject
|
||||
class TestIByteArray : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -56,7 +56,7 @@ private Q_SLOTS:
|
||||
void testContains();
|
||||
};
|
||||
|
||||
void TestQIByteArray::testContains()
|
||||
void TestIByteArray::testContains()
|
||||
{
|
||||
QHttpEngine::IByteArray v(Value1);
|
||||
|
||||
@@ -65,5 +65,5 @@ void TestQIByteArray::testContains()
|
||||
QVERIFY(v.contains(QByteArray(Value2)));
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQIByteArray)
|
||||
#include "TestQIByteArray.moc"
|
||||
QTEST_MAIN(TestIByteArray)
|
||||
#include "TestIByteArray.moc"
|
||||
@@ -36,7 +36,7 @@ const QByteArray HeaderName = "X-Test";
|
||||
const QByteArray CustomName = "Name";
|
||||
const QByteArray CustomData = "Data";
|
||||
|
||||
class TestQLocalAuth : public QObject
|
||||
class TestLocalAuthMiddleware : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -45,7 +45,7 @@ private Q_SLOTS:
|
||||
void testAuth();
|
||||
};
|
||||
|
||||
void TestQLocalAuth::testAuth()
|
||||
void TestLocalAuthMiddleware::testAuth()
|
||||
{
|
||||
QSocketPair pair;
|
||||
QTRY_VERIFY(pair.isConnected());
|
||||
@@ -75,5 +75,5 @@ void TestQLocalAuth::testAuth()
|
||||
QVERIFY(localAuth.process(&socket));
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQLocalAuth)
|
||||
#include "TestQLocalAuth.moc"
|
||||
QTEST_MAIN(TestLocalAuthMiddleware)
|
||||
#include "TestLocalAuthMiddleware.moc"
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
const QString ApplicationName = "QHttpEngine";
|
||||
|
||||
class TestQLocalFile : public QObject
|
||||
class TestLocalFile : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -39,17 +39,17 @@ private Q_SLOTS:
|
||||
void testOpen();
|
||||
};
|
||||
|
||||
void TestQLocalFile::initTestCase()
|
||||
void TestLocalFile::initTestCase()
|
||||
{
|
||||
QCoreApplication::setApplicationName(ApplicationName);
|
||||
}
|
||||
|
||||
void TestQLocalFile::testOpen()
|
||||
void TestLocalFile::testOpen()
|
||||
{
|
||||
QHttpEngine::LocalFile file;
|
||||
QVERIFY(file.open());
|
||||
QVERIFY(file.remove());
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQLocalFile)
|
||||
#include "TestQLocalFile.moc"
|
||||
QTEST_MAIN(TestLocalFile)
|
||||
#include "TestLocalFile.moc"
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class TestQHttpMiddleware : public QObject
|
||||
class TestMiddleware : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -51,7 +51,7 @@ private Q_SLOTS:
|
||||
void testProcess();
|
||||
};
|
||||
|
||||
void TestQHttpMiddleware::testProcess()
|
||||
void TestMiddleware::testProcess()
|
||||
{
|
||||
QSocketPair pair;
|
||||
QTRY_VERIFY(pair.isConnected());
|
||||
@@ -70,5 +70,5 @@ void TestQHttpMiddleware::testProcess()
|
||||
QTRY_COMPARE(client.statusCode(), static_cast<int>(QHttpEngine::Socket::Forbidden));
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQHttpMiddleware)
|
||||
#include "TestQHttpMiddleware.moc"
|
||||
QTEST_MAIN(TestMiddleware)
|
||||
#include "TestMiddleware.moc"
|
||||
@@ -42,13 +42,13 @@ const QHttpEngine::IByteArray Key2 = "c";
|
||||
const QByteArray Value2 = "d";
|
||||
const QByteArray Line2 = Key2 + ": " + Value2;
|
||||
|
||||
class TestQHttpParser : public QObject
|
||||
class TestParser : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
TestQHttpParser();
|
||||
TestParser();
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
@@ -75,13 +75,13 @@ private:
|
||||
QHttpEngine::Socket::HeaderMap headers;
|
||||
};
|
||||
|
||||
TestQHttpParser::TestQHttpParser()
|
||||
TestParser::TestParser()
|
||||
{
|
||||
headers.insert(Key1, Value1);
|
||||
headers.insert(Key2, Value2);
|
||||
}
|
||||
|
||||
void TestQHttpParser::testSplit_data()
|
||||
void TestParser::testSplit_data()
|
||||
{
|
||||
QTest::addColumn<QByteArray>("data");
|
||||
QTest::addColumn<QByteArray>("delim");
|
||||
@@ -119,7 +119,7 @@ void TestQHttpParser::testSplit_data()
|
||||
<< (QByteArrayList() << "a" << "a,a");
|
||||
}
|
||||
|
||||
void TestQHttpParser::testSplit()
|
||||
void TestParser::testSplit()
|
||||
{
|
||||
QFETCH(QByteArray, data);
|
||||
QFETCH(QByteArray, delim);
|
||||
@@ -132,7 +132,7 @@ void TestQHttpParser::testSplit()
|
||||
QCOMPARE(outParts, parts);
|
||||
}
|
||||
|
||||
void TestQHttpParser::testParsePath_data()
|
||||
void TestParser::testParsePath_data()
|
||||
{
|
||||
QTest::addColumn<QByteArray>("rawPath");
|
||||
QTest::addColumn<QString>("path");
|
||||
@@ -149,7 +149,7 @@ void TestQHttpParser::testParsePath_data()
|
||||
<< QHttpEngine::Socket::QueryStringMap{{"a", "b"}};
|
||||
}
|
||||
|
||||
void TestQHttpParser::testParsePath()
|
||||
void TestParser::testParsePath()
|
||||
{
|
||||
QFETCH(QByteArray, rawPath);
|
||||
QFETCH(QString, path);
|
||||
@@ -164,7 +164,7 @@ void TestQHttpParser::testParsePath()
|
||||
QCOMPARE(map, outMap);
|
||||
}
|
||||
|
||||
void TestQHttpParser::testParseHeaderList_data()
|
||||
void TestParser::testParseHeaderList_data()
|
||||
{
|
||||
QTest::addColumn<bool>("success");
|
||||
QTest::addColumn<QByteArrayList>("lines");
|
||||
@@ -180,7 +180,7 @@ void TestQHttpParser::testParseHeaderList_data()
|
||||
<< headers;
|
||||
}
|
||||
|
||||
void TestQHttpParser::testParseHeaderList()
|
||||
void TestParser::testParseHeaderList()
|
||||
{
|
||||
QFETCH(bool, success);
|
||||
QFETCH(QByteArrayList, lines);
|
||||
@@ -194,7 +194,7 @@ void TestQHttpParser::testParseHeaderList()
|
||||
}
|
||||
}
|
||||
|
||||
void TestQHttpParser::testParseHeaders_data()
|
||||
void TestParser::testParseHeaders_data()
|
||||
{
|
||||
QTest::addColumn<bool>("success");
|
||||
QTest::addColumn<QByteArray>("data");
|
||||
@@ -210,7 +210,7 @@ void TestQHttpParser::testParseHeaders_data()
|
||||
<< (QByteArrayList() << "GET" << "/" << "HTTP/1.0");
|
||||
}
|
||||
|
||||
void TestQHttpParser::testParseHeaders()
|
||||
void TestParser::testParseHeaders()
|
||||
{
|
||||
QFETCH(bool, success);
|
||||
QFETCH(QByteArray, data);
|
||||
@@ -226,7 +226,7 @@ void TestQHttpParser::testParseHeaders()
|
||||
}
|
||||
}
|
||||
|
||||
void TestQHttpParser::testParseRequestHeaders_data()
|
||||
void TestParser::testParseRequestHeaders_data()
|
||||
{
|
||||
QTest::addColumn<bool>("success");
|
||||
QTest::addColumn<QByteArray>("data");
|
||||
@@ -244,7 +244,7 @@ void TestQHttpParser::testParseRequestHeaders_data()
|
||||
<< QByteArray("/");
|
||||
}
|
||||
|
||||
void TestQHttpParser::testParseRequestHeaders()
|
||||
void TestParser::testParseRequestHeaders()
|
||||
{
|
||||
QFETCH(bool, success);
|
||||
QFETCH(QByteArray, data);
|
||||
@@ -264,7 +264,7 @@ void TestQHttpParser::testParseRequestHeaders()
|
||||
}
|
||||
}
|
||||
|
||||
void TestQHttpParser::testParseResponseHeaders_data()
|
||||
void TestParser::testParseResponseHeaders_data()
|
||||
{
|
||||
QTest::addColumn<bool>("success");
|
||||
QTest::addColumn<QByteArray>("data");
|
||||
@@ -282,7 +282,7 @@ void TestQHttpParser::testParseResponseHeaders_data()
|
||||
<< QByteArray("NOT FOUND");
|
||||
}
|
||||
|
||||
void TestQHttpParser::testParseResponseHeaders()
|
||||
void TestParser::testParseResponseHeaders()
|
||||
{
|
||||
QFETCH(bool, success);
|
||||
QFETCH(QByteArray, data);
|
||||
@@ -302,5 +302,5 @@ void TestQHttpParser::testParseResponseHeaders()
|
||||
}
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQHttpParser)
|
||||
#include "TestQHttpParser.moc"
|
||||
QTEST_MAIN(TestParser)
|
||||
#include "TestParser.moc"
|
||||
@@ -35,7 +35,7 @@
|
||||
const QString Path = "test";
|
||||
const QByteArray Data = "test";
|
||||
|
||||
class TestQProxyHandler : public QObject
|
||||
class TestProxyHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -44,7 +44,7 @@ private Q_SLOTS:
|
||||
void testDataPassthrough();
|
||||
};
|
||||
|
||||
void TestQProxyHandler::testDataPassthrough()
|
||||
void TestProxyHandler::testDataPassthrough()
|
||||
{
|
||||
// Create the upstream handler (simple echo)
|
||||
QHttpEngine::QObjectHandler upstreamHandler;
|
||||
@@ -81,5 +81,5 @@ void TestQProxyHandler::testDataPassthrough()
|
||||
QTRY_COMPARE(client.data(), Data);
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQProxyHandler)
|
||||
#include "TestQProxyHandler.moc"
|
||||
QTEST_MAIN(TestProxyHandler)
|
||||
#include "TestProxyHandler.moc"
|
||||
@@ -26,13 +26,13 @@
|
||||
|
||||
#include <qhttpengine/range.h>
|
||||
|
||||
class TestQHttpRange : public QObject
|
||||
class TestRange : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
TestQHttpRange();
|
||||
TestRange();
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
@@ -52,18 +52,18 @@ private Q_SLOTS:
|
||||
void testContentRange();
|
||||
};
|
||||
|
||||
TestQHttpRange::TestQHttpRange()
|
||||
TestRange::TestRange()
|
||||
{
|
||||
}
|
||||
|
||||
void TestQHttpRange::testDefaultConstructor()
|
||||
void TestRange::testDefaultConstructor()
|
||||
{
|
||||
QHttpEngine::Range range;
|
||||
|
||||
QCOMPARE(range.isValid(), false);
|
||||
}
|
||||
|
||||
void TestQHttpRange::testAssignmentOperator()
|
||||
void TestRange::testAssignmentOperator()
|
||||
{
|
||||
QHttpEngine::Range range;
|
||||
QHttpEngine::Range otherRange(100, 200, -1);
|
||||
@@ -75,7 +75,7 @@ void TestQHttpRange::testAssignmentOperator()
|
||||
QCOMPARE(range.to(), 200);
|
||||
}
|
||||
|
||||
void TestQHttpRange::testFromToLength_data()
|
||||
void TestRange::testFromToLength_data()
|
||||
{
|
||||
QTest::addColumn<int>("inFrom");
|
||||
QTest::addColumn<int>("inTo");
|
||||
@@ -101,7 +101,7 @@ void TestQHttpRange::testFromToLength_data()
|
||||
<< 10 << 99 << 90;
|
||||
}
|
||||
|
||||
void TestQHttpRange::testFromToLength()
|
||||
void TestRange::testFromToLength()
|
||||
{
|
||||
QFETCH(int, inFrom);
|
||||
QFETCH(int, inTo);
|
||||
@@ -117,7 +117,7 @@ void TestQHttpRange::testFromToLength()
|
||||
QCOMPARE(range.length(), length);
|
||||
}
|
||||
|
||||
void TestQHttpRange::testIsValid_data()
|
||||
void TestRange::testIsValid_data()
|
||||
{
|
||||
QTest::addColumn<int>("from");
|
||||
QTest::addColumn<int>("to");
|
||||
@@ -155,7 +155,7 @@ void TestQHttpRange::testIsValid_data()
|
||||
<< 500 << -1 << 499 << false;
|
||||
}
|
||||
|
||||
void TestQHttpRange::testIsValid()
|
||||
void TestRange::testIsValid()
|
||||
{
|
||||
QFETCH(int, from);
|
||||
QFETCH(int, to);
|
||||
@@ -167,7 +167,7 @@ void TestQHttpRange::testIsValid()
|
||||
QCOMPARE(range.isValid(), valid);
|
||||
}
|
||||
|
||||
void TestQHttpRange::testParseFromString_data()
|
||||
void TestRange::testParseFromString_data()
|
||||
{
|
||||
QTest::addColumn<QString>("data");
|
||||
QTest::addColumn<int>("dataSize");
|
||||
@@ -229,7 +229,7 @@ void TestQHttpRange::testParseFromString_data()
|
||||
<< false;
|
||||
}
|
||||
|
||||
void TestQHttpRange::testParseFromString()
|
||||
void TestRange::testParseFromString()
|
||||
{
|
||||
QFETCH(QString, data);
|
||||
QFETCH(int, dataSize);
|
||||
@@ -250,7 +250,7 @@ void TestQHttpRange::testParseFromString()
|
||||
}
|
||||
}
|
||||
|
||||
void TestQHttpRange::testContentRange_data()
|
||||
void TestRange::testContentRange_data()
|
||||
{
|
||||
QTest::addColumn<int>("from");
|
||||
QTest::addColumn<int>("to");
|
||||
@@ -274,7 +274,7 @@ void TestQHttpRange::testContentRange_data()
|
||||
<< "";
|
||||
}
|
||||
|
||||
void TestQHttpRange::testContentRange()
|
||||
void TestRange::testContentRange()
|
||||
{
|
||||
QFETCH(int, from);
|
||||
QFETCH(int, to);
|
||||
@@ -286,5 +286,5 @@ void TestQHttpRange::testContentRange()
|
||||
QCOMPARE(range.contentRange(), contentRange);
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQHttpRange)
|
||||
#include "TestQHttpRange.moc"
|
||||
QTEST_MAIN(TestRange)
|
||||
#include "TestRange.moc"
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
QString mPath;
|
||||
};
|
||||
|
||||
class TestQHttpServer : public QObject
|
||||
class TestServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -67,7 +67,7 @@ private Q_SLOTS:
|
||||
#endif
|
||||
};
|
||||
|
||||
void TestQHttpServer::testServer()
|
||||
void TestServer::testServer()
|
||||
{
|
||||
TestHandler handler;
|
||||
QHttpEngine::Server server(&handler);
|
||||
@@ -90,7 +90,7 @@ void TestQHttpServer::testServer()
|
||||
}
|
||||
|
||||
#if !defined(QT_NO_SSL)
|
||||
void TestQHttpServer::testSsl()
|
||||
void TestServer::testSsl()
|
||||
{
|
||||
QFile keyFile(":/key.pem");
|
||||
QVERIFY(keyFile.open(QIODevice::ReadOnly));
|
||||
@@ -119,5 +119,5 @@ void TestQHttpServer::testSsl()
|
||||
}
|
||||
#endif
|
||||
|
||||
QTEST_MAIN(TestQHttpServer)
|
||||
#include "TestQHttpServer.moc"
|
||||
QTEST_MAIN(TestServer)
|
||||
#include "TestServer.moc"
|
||||
@@ -49,13 +49,13 @@ const int StatusCode = 404;
|
||||
const QByteArray StatusReason = "NOT FOUND";
|
||||
const QByteArray Data = "test";
|
||||
|
||||
class TestQHttpSocket : public QObject
|
||||
class TestSocket : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
TestQHttpSocket();
|
||||
TestSocket();
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
@@ -70,13 +70,13 @@ private:
|
||||
QHttpEngine::Socket::HeaderMap headers;
|
||||
};
|
||||
|
||||
TestQHttpSocket::TestQHttpSocket()
|
||||
TestSocket::TestSocket()
|
||||
{
|
||||
headers.insert("Content-Type", "text/plain");
|
||||
headers.insert("Content-Length", QByteArray::number(Data.length()));
|
||||
}
|
||||
|
||||
void TestQHttpSocket::testProperties()
|
||||
void TestSocket::testProperties()
|
||||
{
|
||||
CREATE_SOCKET_PAIR();
|
||||
|
||||
@@ -95,7 +95,7 @@ void TestQHttpSocket::testProperties()
|
||||
QCOMPARE(client.headers(), headers);
|
||||
}
|
||||
|
||||
void TestQHttpSocket::testData()
|
||||
void TestSocket::testData()
|
||||
{
|
||||
CREATE_SOCKET_PAIR();
|
||||
|
||||
@@ -112,7 +112,7 @@ void TestQHttpSocket::testData()
|
||||
QTRY_COMPARE(client.data(), Data);
|
||||
}
|
||||
|
||||
void TestQHttpSocket::testRedirect()
|
||||
void TestSocket::testRedirect()
|
||||
{
|
||||
CREATE_SOCKET_PAIR();
|
||||
|
||||
@@ -125,7 +125,7 @@ void TestQHttpSocket::testRedirect()
|
||||
QTRY_COMPARE(disconnectedSpy.count(), 1);
|
||||
}
|
||||
|
||||
void TestQHttpSocket::testSignals()
|
||||
void TestSocket::testSignals()
|
||||
{
|
||||
CREATE_SOCKET_PAIR();
|
||||
|
||||
@@ -163,7 +163,7 @@ void TestQHttpSocket::testSignals()
|
||||
QTRY_COMPARE(aboutToCloseSpy.count(), 1);
|
||||
}
|
||||
|
||||
void TestQHttpSocket::testJson()
|
||||
void TestSocket::testJson()
|
||||
{
|
||||
CREATE_SOCKET_PAIR();
|
||||
|
||||
@@ -184,5 +184,5 @@ void TestQHttpSocket::testJson()
|
||||
QCOMPARE(document.object(), object);
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQHttpSocket)
|
||||
#include "TestQHttpSocket.moc"
|
||||
QTEST_MAIN(TestSocket)
|
||||
#include "TestSocket.moc"
|
||||
Reference in New Issue
Block a user