summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2020-01-17 12:24:06 +0100
committerDominik Holland <dominik.holland@qt.io>2020-01-21 16:03:09 +0100
commit45317b232c926276555f8dc100be21988ea46405 (patch)
tree41a793f540f18911622836d97301bfff4a19a626 /tests
parent895d5505bb74148a4464947b31bfdbb4c11f5637 (diff)
downloadqtivi-45317b232c926276555f8dc100be21988ea46405.tar.gz
simulation: Fix struct initialization using JSON dictionaries
Instead of using a list of values to fill all members, it is also possible to use a dictionary, which is more expressive. This fixes the conversion function and adds an autotest for it. Change-Id: I7b817a26622f95c7e9fe4d3ff853310c5ad87f32 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/core/qivisimulationglobalobject/tst_qivisimulationglobalobject.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/core/qivisimulationglobalobject/tst_qivisimulationglobalobject.cpp b/tests/auto/core/qivisimulationglobalobject/tst_qivisimulationglobalobject.cpp
index 1603b5f..546520a 100644
--- a/tests/auto/core/qivisimulationglobalobject/tst_qivisimulationglobalobject.cpp
+++ b/tests/auto/core/qivisimulationglobalobject/tst_qivisimulationglobalobject.cpp
@@ -344,6 +344,8 @@ void tst_QIviSimulationGlobalObject::testParseDomainValue_data()
<< QVariant::fromValue(SimpleAPI::EnumValue1);
QTest::newRow("TestStruct by list") << "{ \"type\": \"TestStruct\", \"value\": [ 100, true ] }"
<< QVariant::fromValue(TestStruct(100, true));
+ QTest::newRow("TestStruct by map") << "{ \"type\": \"TestStruct\", \"value\": { \"intProperty\": 100, \"boolProperty\": true } }"
+ << QVariant::fromValue(TestStruct(100, true));
}
void tst_QIviSimulationGlobalObject::testParseDomainValue()