summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qresourceengine
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2018-05-03 12:18:24 +0200
committerOliver Wolff <oliver.wolff@qt.io>2018-05-07 07:59:37 +0000
commita27f888dec9c838d5e64496be0e5a5e6d980db32 (patch)
treeae9e416609e9bdc9d15c8daa7cd86a4af8347ed0 /tests/auto/corelib/io/qresourceengine
parent4dada8068a8a5c4cd52958cf25fd2a50b1af5ac0 (diff)
tst_qresourceengine: Fix test for configurations with builtin_testdata
If builtin_testdata is present additional data ends in inside of resources so that tests can access this data when needed. The addiitonal data has to be taken into account in the resource engine's test. Change-Id: I10de6b9612ca49b314d77cfadd5b2360a5d90d53 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'tests/auto/corelib/io/qresourceengine')
-rw-r--r--tests/auto/corelib/io/qresourceengine/qresourceengine.pro2
-rw-r--r--tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp12
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro
index f937d23fe2..e8071297b1 100644
--- a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro
+++ b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro
@@ -21,3 +21,5 @@ GENERATED_TESTDATA = $${runtime_resource.target}
android:!android-embedded {
RESOURCES += android_testdata.qrc
}
+
+builtin_testdata: DEFINES += BUILTIN_TESTDATA
diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
index ab1866fb2d..9de2aabd31 100644
--- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
+++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
@@ -125,9 +125,19 @@ void tst_QResourceEngine::checkStructure_data()
rootContents.insert(1, QLatin1String("android_testdata"));
#endif
+#if defined(BUILTIN_TESTDATA)
+ rootContents.insert(8, QLatin1String("testqrc"));
+#endif
+
+
QTest::newRow("root dir") << QString(":/")
<< QString()
- << (QStringList() << "search_file.txt")
+ << (QStringList()
+#if defined(BUILTIN_TESTDATA)
+ << "parentdir.txt"
+ << "runtime_resource.rcc"
+#endif
+ << "search_file.txt")
<< rootContents
<< QLocale::c()
<< qlonglong(0);