diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-09 13:18:37 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-14 09:42:30 +0000 |
commit | b790a7aa74653bf3d9125b30f262c37e389ac131 (patch) | |
tree | a49493eb1b1e5447ca3ff99670f55327a25d2454 /tests | |
parent | 945a1db8e27bb7f8f7edb1e55bf746104e723dd4 (diff) |
ModuleLoader: Remove invalid assertion
The assumption that all list properties must have acquired a defining
item at some point is simply wrong.
Change-Id: I34d035e50b5d5cd8c62f1baba899326b92ade8d1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/language/testdata/modulepropertiesingroups.qbs | 12 | ||||
-rw-r--r-- | tests/auto/language/tst_language.cpp | 23 |
2 files changed, 34 insertions, 1 deletions
diff --git a/tests/auto/language/testdata/modulepropertiesingroups.qbs b/tests/auto/language/testdata/modulepropertiesingroups.qbs index 7a0a99b3e..5a1e75ab8 100644 --- a/tests/auto/language/testdata/modulepropertiesingroups.qbs +++ b/tests/auto/language/testdata/modulepropertiesingroups.qbs @@ -70,4 +70,16 @@ Project { } } } + Product { + name: "grouptest2" + Depends { name: "gmod.gmod1" } + Group { + name: "g1" + gmod.gmod1.gmod1_list2: ["G1"] + Group { + name: "g1.1" + gmod.gmod1.gmod1_string: "G1.1" + } + } + } } diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp index 6ee7a42a1..19c67eda3 100644 --- a/tests/auto/language/tst_language.cpp +++ b/tests/auto/language/tst_language.cpp @@ -1321,7 +1321,7 @@ void TestLanguage::modulePropertiesInGroups() TopLevelProjectPtr project = loader->loadProject(defaultParameters); QVERIFY(!!project); const QHash<QString, ResolvedProductPtr> products = productsFromProject(project); - const ResolvedProductPtr product = products.value("grouptest"); + ResolvedProductPtr product = products.value("grouptest"); QVERIFY(!!product); GroupConstPtr g1; GroupConstPtr g11; @@ -1498,6 +1498,27 @@ void TestLanguage::modulePropertiesInGroups() QEXPECT_FAIL(0, "re-eval not triggered", Continue); QCOMPARE(g211Gmod2List, QStringList() << "g2.1.1" << "commonName_in_gmod1" << "g2.1.1_gmod4_g2.1.1_gmod3" << "g2.1.1_gmod3" << "gmod2_list_proto"); + + product = products.value("grouptest2"); + QVERIFY(!!product); + g1.reset(); + g11.reset(); + foreach (const GroupConstPtr &g, product->groups) { + if (g->name == "g1") + g1= g; + else if (g->name == "g1.1") + g11 = g; + } + QVERIFY(!!g1); + QVERIFY(!!g11); + QCOMPARE(moduleProperty(g1->properties->value(), "gmod.gmod1", "gmod1_list2") + .toStringList(), QStringList({"G1"})); + QCOMPARE(moduleProperty(g11->properties->value(), "gmod.gmod1", "gmod1_list2") + .toStringList(), + moduleProperty(g1->properties->value(), "gmod.gmod1", "gmod1_list2") + .toStringList()); + QCOMPARE(moduleProperty(g11->properties->value(), "gmod.gmod1", "gmod1_string").toString(), + QString("G1.1")); } catch (const ErrorInfo &e) { exceptionCaught = true; qDebug() << e.toString(); |