aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickpixmapcache
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/qquickpixmapcache
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/qquickpixmapcache')
-rw-r--r--tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
index 75bd468aef..f104154205 100644
--- a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
+++ b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
@@ -59,7 +59,7 @@ class tst_qquickpixmapcache : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickpixmapcache() : server(14452) {}
+ tst_qquickpixmapcache() {}
private slots:
void initTestCase();
@@ -116,6 +116,8 @@ void tst_qquickpixmapcache::initTestCase()
{
QQmlDataTest::initTestCase();
+ QVERIFY2(server.listen(14452), qPrintable(server.errorString()));
+
// This avoids a race condition/deadlock bug in network config
// manager when it is accessed by the HTTP server thread before
// anything else. Bug report can be found at:
@@ -379,7 +381,8 @@ void tst_qquickpixmapcache::shrinkcache()
void createNetworkServer()
{
QEventLoop eventLoop;
- TestHTTPServer server(14453);
+ TestHTTPServer server;
+ QVERIFY2(server.listen(14453), qPrintable(server.errorString()));
server.serveDirectory(QQmlDataTest::instance()->testFile("http"));
QTimer::singleShot(100, &eventLoop, SLOT(quit()));
eventLoop.exec();
@@ -407,7 +410,8 @@ void tst_qquickpixmapcache::networkCrash()
// QTBUG-22125
void tst_qquickpixmapcache::lockingCrash()
{
- TestHTTPServer server(14453);
+ TestHTTPServer server;
+ QVERIFY2(server.listen(14453), qPrintable(server.errorString()));
server.serveDirectory(testFile("http"), TestHTTPServer::Delay);
{