summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-01-04 21:42:35 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-01-04 21:42:35 (GMT)
commit996f70344a9e7f349523bb77cdd5e9044d7aeaec (patch)
treef4f0dc1f2c99599806e2a03ddbe4c2e22fbcd347 /tests
parent697e236c096d62137fdd155f5ef8d72a26b8636b (diff)
parente3d094809d0591ce8f003ac3e881860c0e448d74 (diff)
downloadQt-996f70344a9e7f349523bb77cdd5e9044d7aeaec.zip
Qt-996f70344a9e7f349523bb77cdd5e9044d7aeaec.tar.gz
Qt-996f70344a9e7f349523bb77cdd5e9044d7aeaec.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Fix QNetworkReply autotest cases for QT-3494 Add compiler optimization for QtScript/JSC on Symbian improve performance of QTextEngine, esp. setBoundary by using non-detaching operator[] Improve docs for QTEST_MAIN macro. Work around an apparent GCC optimiser bug accessing arrays beyond end Do not crash in case a future version of libdbus has a new kind of message. Docs: QTBUG-9150 Incorrect snippet in class doc. tst_headers: make failure more detailed when failing to open a file Fix number of chapters in qtestlib tutorial. Fixed QStatusBar not to repaint itself too early QNAM HTTP: Fix missing error() signal Make it clear which security updates are needed for Visual Studio 2005.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/headers/tst_headers.cpp6
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp22
2 files changed, 16 insertions, 12 deletions
diff --git a/tests/auto/headers/tst_headers.cpp b/tests/auto/headers/tst_headers.cpp
index 7ccf058..8c8bc2c 100644
--- a/tests/auto/headers/tst_headers.cpp
+++ b/tests/auto/headers/tst_headers.cpp
@@ -203,7 +203,7 @@ void tst_Headers::licenseCheck()
QFETCH(QString, sourceFile);
QFile f(sourceFile);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString()));
QByteArray data = f.readAll();
data.replace("\r\n", "\n"); // Windows
data.replace('\r', '\n'); // Mac OS9
@@ -264,7 +264,7 @@ void tst_Headers::privateSlots()
return;
QFile f(header);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString()));
QStringList content = QString::fromLocal8Bit(f.readAll()).split("\n");
foreach (QString line, content) {
@@ -286,7 +286,7 @@ void tst_Headers::macros()
return;
QFile f(header);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString()));
QByteArray data = f.readAll();
QStringList content = QString::fromLocal8Bit(data.replace('\r', "")).split("\n");
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index cff0ae9..6cd9d3c 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -2585,17 +2585,19 @@ void tst_QNetworkReply::ioGetFromHttpBrokenServer()
void tst_QNetworkReply::ioGetFromHttpStatus100_data()
{
QTest::addColumn<QByteArray>("dataToSend");
- QTest::newRow("normal") << QByteArray("HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- QTest::newRow("minimal") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- QTest::newRow("minimal2") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\r\n\r\n");
- QTest::newRow("minimal3") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\n\n");
- QTest::newRow("with_headers") << QByteArray("HTTP/1.1 100 Continue\r\nBla: x\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- QTest::newRow("with_headers2") << QByteArray("HTTP/1.1 100 Continue\nBla: x\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
+ QTest::addColumn<QNetworkReply::NetworkError>("expectedError");
+ QTest::newRow("normal") << QByteArray("HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << QNetworkReply::NoError;
+ QTest::newRow("minimal") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << QNetworkReply::NoError;
+ QTest::newRow("minimal2") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\r\n\r\n") << QNetworkReply::RemoteHostClosedError;
+ QTest::newRow("minimal3") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\n\n") << QNetworkReply::RemoteHostClosedError;
+ QTest::newRow("with_headers") << QByteArray("HTTP/1.1 100 Continue\r\nBla: x\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << QNetworkReply::NoError;
+ QTest::newRow("with_headers2") << QByteArray("HTTP/1.1 100 Continue\nBla: x\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << QNetworkReply::NoError;
}
void tst_QNetworkReply::ioGetFromHttpStatus100()
{
QFETCH(QByteArray, dataToSend);
+ QFETCH(QNetworkReply::NetworkError, expectedError);
MiniHttpServer server(dataToSend);
server.doClose = true;
@@ -2607,7 +2609,7 @@ void tst_QNetworkReply::ioGetFromHttpStatus100()
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->url(), request.url());
- QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QCOMPARE(reply->error(), expectedError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
QVERIFY(reply->rawHeader("bla").isNull());
}
@@ -2615,12 +2617,14 @@ void tst_QNetworkReply::ioGetFromHttpStatus100()
void tst_QNetworkReply::ioGetFromHttpNoHeaders_data()
{
QTest::addColumn<QByteArray>("dataToSend");
- QTest::newRow("justStatus+noheaders+disconnect") << QByteArray("HTTP/1.0 200 OK\r\n\r\n");
+ QTest::addColumn<QNetworkReply::NetworkError>("expectedError");
+ QTest::newRow("justStatus+noheaders+disconnect") << QByteArray("HTTP/1.0 200 OK\r\n\r\n") << QNetworkReply::RemoteHostClosedError;
}
void tst_QNetworkReply::ioGetFromHttpNoHeaders()
{
QFETCH(QByteArray, dataToSend);
+ QFETCH(QNetworkReply::NetworkError, expectedError);
MiniHttpServer server(dataToSend);
server.doClose = true;
@@ -2632,7 +2636,7 @@ void tst_QNetworkReply::ioGetFromHttpNoHeaders()
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->url(), request.url());
- QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QCOMPARE(reply->error(), expectedError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
}