diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-07-03 14:00:25 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-05 07:14:07 +0200 |
commit | 94a519372021708febd890d0cfe5c4be70948970 (patch) | |
tree | aa90cbc3e6c7adb7677ef2a251d37005a1c15029 /tests/auto/quick/qquicktext | |
parent | 2edefe36773db0cbe837c33f65d0cde577ccb67a (diff) |
Use unique port numbers for http servers in auto tests.
Prevents conflicts when tests are run in parallel.
Change-Id: Ic1652d963da291c7c41b31e2621874824fa575cb
Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquicktext')
4 files changed, 12 insertions, 9 deletions
diff --git a/tests/auto/quick/qquicktext/data/embeddedImagesRemote.qml b/tests/auto/quick/qquicktext/data/embeddedImagesRemote.qml index 702633c538..5d241f9231 100644 --- a/tests/auto/quick/qquicktext/data/embeddedImagesRemote.qml +++ b/tests/auto/quick/qquicktext/data/embeddedImagesRemote.qml @@ -2,5 +2,5 @@ import QtQuick 2.0 Text { textFormat: Text.RichText - text: "<img src='http://127.0.0.1:14453/exists.png'>" + text: "<img src='http://127.0.0.1:14459/exists.png'>" } diff --git a/tests/auto/quick/qquicktext/data/embeddedImagesRemoteError.qml b/tests/auto/quick/qquicktext/data/embeddedImagesRemoteError.qml index 5762f3e47d..adeed8834d 100644 --- a/tests/auto/quick/qquicktext/data/embeddedImagesRemoteError.qml +++ b/tests/auto/quick/qquicktext/data/embeddedImagesRemoteError.qml @@ -2,5 +2,5 @@ import QtQuick 2.0 Text { textFormat: Text.RichText - text: "<img src='http://127.0.0.1:14453/notexists.png'>" + text: "<img src='http://127.0.0.1:14459/notexists.png'>" } diff --git a/tests/auto/quick/qquicktext/data/embeddedImagesRemoteRelative.qml b/tests/auto/quick/qquicktext/data/embeddedImagesRemoteRelative.qml index cee19740f9..2835d813db 100644 --- a/tests/auto/quick/qquicktext/data/embeddedImagesRemoteRelative.qml +++ b/tests/auto/quick/qquicktext/data/embeddedImagesRemoteRelative.qml @@ -3,5 +3,5 @@ import QtQuick 2.0 Text { textFormat: Text.RichText text: "<img src='exists.png'>" - baseUrl: "http://127.0.0.1:14453/text.html" + baseUrl: "http://127.0.0.1:14459/text.html" } diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp index 2bdf4a91b4..0adddb9c85 100644 --- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp @@ -57,6 +57,9 @@ DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD) +#define SERVER_PORT 14459 +#define SERVER_ADDR "http://127.0.0.1:14459" + Q_DECLARE_METATYPE(QQuickText::TextFormat) class tst_qquicktext : public QQmlDataTest @@ -1829,7 +1832,7 @@ void tst_qquicktext::embeddedImages_data() QTest::newRow("local") << testFileUrl("embeddedImagesLocalRelative.qml") << ""; QTest::newRow("remote") << testFileUrl("embeddedImagesRemote.qml") << ""; QTest::newRow("remote-error") << testFileUrl("embeddedImagesRemoteError.qml") - << testFileUrl("embeddedImagesRemoteError.qml").toString()+":3:1: QML Text: Error downloading http://127.0.0.1:14453/notexists.png - server replied: Not found"; + << testFileUrl("embeddedImagesRemoteError.qml").toString()+":3:1: QML Text: Error downloading " SERVER_ADDR "/notexists.png - server replied: Not found"; QTest::newRow("remote") << testFileUrl("embeddedImagesRemoteRelative.qml") << ""; } @@ -1840,7 +1843,7 @@ void tst_qquicktext::embeddedImages() QFETCH(QUrl, qmlfile); QFETCH(QString, error); - TestHTTPServer server(14453); + TestHTTPServer server(SERVER_PORT); server.serveDirectory(testFile("http")); if (!error.isEmpty()) @@ -2280,18 +2283,18 @@ void tst_qquicktext::imgTagsBaseUrl_data() << 181.; QTest::newRow("absolute remote") - << QUrl("http://127.0.0.1:14453/images/heart200.png") + << QUrl(SERVER_ADDR "/images/heart200.png") << QUrl() << QUrl() << 181.; QTest::newRow("relative remote base 1") << QUrl("images/heart200.png") - << QUrl("http://127.0.0.1:14453/") + << QUrl(SERVER_ADDR "/") << testFileUrl("nonexistant/app.qml") << 181.; QTest::newRow("relative remote base 2") << QUrl("heart200.png") - << QUrl("http://127.0.0.1:14453/images/") + << QUrl(SERVER_ADDR "/images/") << testFileUrl("nonexistant/app.qml") << 181.; } @@ -2303,7 +2306,7 @@ void tst_qquicktext::imgTagsBaseUrl() QFETCH(QUrl, contextUrl); QFETCH(qreal, imgHeight); - TestHTTPServer server(14453); + TestHTTPServer server(SERVER_PORT); server.serveDirectory(testFile("")); QByteArray baseUrlFragment; |