diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-01-06 03:39:14 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-01-25 14:08:58 (GMT) |
commit | 44d0d663d4972b2d8a0248e4ea3222a46942ff0e (patch) | |
tree | a29876e13ac1e87f084256d9d4b8a83bf2a545e0 /tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp | |
parent | 226aeef6f0fa1155a94171f2a4c531ad49c3ea00 (diff) | |
download | Qt-44d0d663d4972b2d8a0248e4ea3222a46942ff0e.zip Qt-44d0d663d4972b2d8a0248e4ea3222a46942ff0e.tar.gz Qt-44d0d663d4972b2d8a0248e4ea3222a46942ff0e.tar.bz2 |
network tests: make IMAP, FTP testdata more flexible.
Move all hardcoded IMAP/FTP fixtures into network-settings.h.
Make it work with new and old network test server.
Reviewed-by: Markus Goetz
Task: QTBUG-15114
Diffstat (limited to 'tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp')
-rw-r--r-- | tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp index f86ba63..972185b 100644 --- a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp +++ b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp @@ -325,7 +325,7 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP() QVERIFY(socketDevice.read(array.data(), array.size()) == available); // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + QVERIFY2(QtNetworkSettings::compareReplyIMAP(array), array.constData()); // Write a logout message @@ -455,7 +455,7 @@ void tst_QHttpSocketEngine::tcpSocketBlockingTest() // Read greeting QVERIFY(socket.waitForReadyRead(5000)); QString s = socket.readLine(); - QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + QVERIFY2(QtNetworkSettings::compareReplyIMAP(s.toLatin1()), qPrintable(s)); // Write NOOP QCOMPARE((int) socket.write("1 NOOP\r\n", 8), 8); @@ -530,8 +530,8 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest() // Read greeting QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); - QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), - QtNetworkSettings::expectedReplyIMAP().constData()); + QByteArray data = tcpSocketNonBlocking_data.at(0).toLatin1(); + QVERIFY2(QtNetworkSettings::compareReplyIMAP(data), data.constData()); tcpSocketNonBlocking_data.clear(); @@ -713,7 +713,7 @@ void tst_QHttpSocketEngine::passwordAuth() QVERIFY(socketDevice.read(array.data(), array.size()) == available); // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + QVERIFY2(QtNetworkSettings::compareReplyIMAP(array), array.constData()); // Write a logout message |