summaryrefslogtreecommitdiffstats
path: root/tests/auto/qhttpsocketengine
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-01-06 13:39:14 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2011-01-10 10:36:06 +1000
commit026a24855ec16626ab101007719a836f5a4e3c47 (patch)
tree73331d0c48023ed9f5489735443d2b56b3d67736 /tests/auto/qhttpsocketengine
parente6286c54bd66c2db06687127fea69fcc398ffbde (diff)
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')
-rw-r--r--tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp
index f86ba63318..972185bd84 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