diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2011-10-12 13:46:02 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-14 02:39:59 +0200 |
commit | 6b497734df0c4f13f6b7185801fc69ce680c698c (patch) | |
tree | 66b0b8cd32a91f8c7e753a3ef124050188035c3c /tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp | |
parent | 5f7c22001163eb4bce25be1cfee4e84c5a25ff09 (diff) |
Use TESTDATA macro in declarative tests.
Includes a few other minor cleanups as well.
Task-number: QTBUG-21721
Change-Id: I5b1c2c116e63748c6b4199183212de8a00037af1
Reviewed-on: http://codereview.qt-project.org/6473
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp index 2c9bcc0c44..a035b4e870 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp @@ -45,6 +45,7 @@ #include <QDebug> #include <QNetworkCookieJar> #include "testhttpserver.h" +#include "../shared/util.h" #include "../../../shared/util.h" #define SERVER_PORT 14445 @@ -122,7 +123,7 @@ private: inline QUrl TEST_FILE(const QString &filename) { - return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename); + return QUrl::fromLocalFile(TESTDATA(filename)); } // Test that the dom exception codes are correct @@ -1018,7 +1019,7 @@ void tst_qdeclarativexmlhttprequest::redirects() TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); server.addRedirect("redirect.html", "http://127.0.0.1:14445/redirecttarget.html"); - server.serveDirectory(SRCDIR "/data"); + server.serveDirectory(TESTDATA("")); QDeclarativeComponent component(&engine, TEST_FILE("redirects.qml")); QObject *object = component.beginCreate(engine.rootContext()); @@ -1037,7 +1038,7 @@ void tst_qdeclarativexmlhttprequest::redirects() TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); server.addRedirect("redirect.html", "http://127.0.0.1:14445/redirectmissing.html"); - server.serveDirectory(SRCDIR "/data"); + server.serveDirectory(TESTDATA("")); QDeclarativeComponent component(&engine, TEST_FILE("redirectError.qml")); QObject *object = component.beginCreate(engine.rootContext()); @@ -1056,7 +1057,7 @@ void tst_qdeclarativexmlhttprequest::redirects() TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); server.addRedirect("redirect.html", "http://127.0.0.1:14445/redirect.html"); - server.serveDirectory(SRCDIR "/data"); + server.serveDirectory(TESTDATA("")); QDeclarativeComponent component(&engine, TEST_FILE("redirectRecur.qml")); QObject *object = component.beginCreate(engine.rootContext()); |