aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickloader
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@jollamobile.com>2014-03-20 23:21:49 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-21 00:09:29 +0100
commitaa578c4e296a3bf5117fd878fcac70d1c11bd255 (patch)
tree3ae73880b0054c99d645bdab3d1d5a043c51ac43 /tests/auto/quick/qquickloader
parent8f49f50a169db85401eb37daf4fe3a0fc3280603 (diff)
TestHTTPServer: Make listening an explicit operation that reports failure.
Use this to print the error message when listening fails, and switch to always stack allocating TestHTTPServer instances for easier cleanup. Change-Id: I63b2bd38963b66611dc08a5c322615d91a91e675 Reviewed-by: John Brooks <john.brooks@dereferenced.net> Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'tests/auto/quick/qquickloader')
-rw-r--r--tests/auto/quick/qquickloader/tst_qquickloader.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/quick/qquickloader/tst_qquickloader.cpp b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
index 877bb59613..9ac2663f24 100644
--- a/tests/auto/quick/qquickloader/tst_qquickloader.cpp
+++ b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
@@ -446,8 +446,8 @@ void tst_QQuickLoader::noResize()
void tst_QQuickLoader::networkRequestUrl()
{
- TestHTTPServer server(SERVER_PORT);
- QVERIFY(server.isValid());
+ TestHTTPServer server;
+ QVERIFY2(server.listen(SERVER_PORT), qPrintable(server.errorString()));
server.serveDirectory(dataDirectory());
QQmlComponent component(&engine);
@@ -470,8 +470,8 @@ void tst_QQuickLoader::networkRequestUrl()
/* XXX Component waits until all dependencies are loaded. Is this actually possible? */
void tst_QQuickLoader::networkComponent()
{
- TestHTTPServer server(SERVER_PORT);
- QVERIFY(server.isValid());
+ TestHTTPServer server;
+ QVERIFY2(server.listen(SERVER_PORT), qPrintable(server.errorString()));
server.serveDirectory(dataDirectory(), TestHTTPServer::Delay);
QQmlComponent component(&engine);
@@ -503,8 +503,8 @@ void tst_QQuickLoader::networkComponent()
void tst_QQuickLoader::failNetworkRequest()
{
- TestHTTPServer server(SERVER_PORT);
- QVERIFY(server.isValid());
+ TestHTTPServer server;
+ QVERIFY2(server.listen(SERVER_PORT), qPrintable(server.errorString()));
server.serveDirectory(dataDirectory());
QTest::ignoreMessage(QtWarningMsg, SERVER_ADDR "/IDontExist.qml: File not found");
@@ -718,8 +718,8 @@ void tst_QQuickLoader::initialPropertyValues()
QFETCH(QStringList, propertyNames);
QFETCH(QVariantList, propertyValues);
- TestHTTPServer server(SERVER_PORT);
- QVERIFY(server.isValid());
+ TestHTTPServer server;
+ QVERIFY2(server.listen(SERVER_PORT), qPrintable(server.errorString()));
server.serveDirectory(dataDirectory());
foreach (const QString &warning, expectedWarnings)