aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qrcqml/tst_qrcqml.cpp
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-07-05 15:00:24 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-06 05:31:13 +0200
commitd65b660d5d7f30058efc74c7cab074641923038f (patch)
tree0cffbdd29139988ffcd4a7631267ee6766e9dacc /tests/auto/qml/qrcqml/tst_qrcqml.cpp
parentaeac9840e4c46786e84ab7eb16a89db22d4ff81a (diff)
Expand test case for qrc:/ URLs
Change-Id: Ibf8a04efbcb9d39938201f65c1fc0f236243a287 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/qml/qrcqml/tst_qrcqml.cpp')
-rw-r--r--tests/auto/qml/qrcqml/tst_qrcqml.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/tests/auto/qml/qrcqml/tst_qrcqml.cpp b/tests/auto/qml/qrcqml/tst_qrcqml.cpp
index b81fff0f08..a09c908069 100644
--- a/tests/auto/qml/qrcqml/tst_qrcqml.cpp
+++ b/tests/auto/qml/qrcqml/tst_qrcqml.cpp
@@ -55,6 +55,7 @@ public:
tst_qrcqml();
private slots:
+ void basicLoad_data();
void basicLoad();
};
@@ -62,16 +63,44 @@ tst_qrcqml::tst_qrcqml()
{
}
+void tst_qrcqml::basicLoad_data()
+{
+ QTest::addColumn<QString>("url");
+ QTest::addColumn<QString>("token");
+
+ QTest::newRow("simple")
+ << "qrc:/data/main.qml"
+ << "foo";
+
+ QTest::newRow("aliased")
+ << "qrc:/main.qml"
+ << "bar";
+
+ QTest::newRow("prefixed")
+ << "qrc:/search/main.qml"
+ << "baz";
+
+ /* This is not supported:
+ QTest::newRow("without qrc scheme")
+ << ":/data/main.qml"
+ << "hello";
+ */
+}
+
void tst_qrcqml::basicLoad()
{
+ QFETCH(QString, url);
+ QFETCH(QString, token);
+
QQmlEngine e;
- QQmlComponent c(&e, QUrl("qrc:/main.qml"));
+ QQmlComponent c(&e, QUrl(url));
QVERIFY(c.isReady());
QObject* o = c.create();
QVERIFY(o);
- QCOMPARE(o->property("tokenProperty").toString(), QLatin1String("hello"));
+ QCOMPARE(o->property("tokenProperty").toString(), token);
delete o;
}
+
QTEST_MAIN(tst_qrcqml)
#include "tst_qrcqml.moc"