diff options
author | Michael Brasser <mbrasser@ford.com> | 2018-10-25 12:50:19 -0500 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2018-10-31 08:21:24 +0000 |
commit | f46f8745053208e4a86fa65e039179b85d5c317b (patch) | |
tree | c397ffeb8394d010eef39c2605983e4b124895a7 /tests | |
parent | 3a614b1c2e78de04b32a957414f5a8d4dd0e07b1 (diff) |
Fix issues with lookup of scoped enums on Singletons
Change-Id: Id6cd0b7c571b38db30bded030f6927c9b5fbdb96
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests')
3 files changed, 16 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/lib/org/qtproject/MixedModule/SingletonType.qml b/tests/auto/qml/qqmllanguage/data/lib/org/qtproject/MixedModule/SingletonType.qml index 2913ceca08..bf5a77576b 100644 --- a/tests/auto/qml/qqmllanguage/data/lib/org/qtproject/MixedModule/SingletonType.qml +++ b/tests/auto/qml/qqmllanguage/data/lib/org/qtproject/MixedModule/SingletonType.qml @@ -3,6 +3,11 @@ pragma Singleton Item { enum EnumInSingleton { - EnumValue = 42 + EnumValue = 42, + AnotherEnumValue + } + + enum AnotherEnumInSingleton { + AnotherEnumValue = 2 } } diff --git a/tests/auto/qml/qqmllanguage/data/usingTypeWithEnum.qml b/tests/auto/qml/qqmllanguage/data/usingTypeWithEnum.qml index 43e54bbf1d..79e8347330 100644 --- a/tests/auto/qml/qqmllanguage/data/usingTypeWithEnum.qml +++ b/tests/auto/qml/qqmllanguage/data/usingTypeWithEnum.qml @@ -7,4 +7,9 @@ QtObject { property int scopedEnumValue: TypeWithEnum.MyEnum.EnumValue3 property int enumValueFromSingleton: { var x = SingletonType.EnumValue; return x; } Component.onCompleted: enumValue2 = TypeWithEnum.EnumValue1 + + property int duplicatedEnumValueFromSingleton: SingletonType.AnotherEnumValue + property int scopedEnumValueFromSingleton1: SingletonType.EnumInSingleton.AnotherEnumValue + property int scopedEnumValueFromSingleton2: SingletonType.AnotherEnumInSingleton.AnotherEnumValue + property int scopedEnumValueFromSingleton3: { var x = SingletonType.AnotherEnumInSingleton.AnotherEnumValue; return x; } } diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 7a8de739f4..89856d6603 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -3860,6 +3860,11 @@ void tst_qqmllanguage::qmlEnums() QCOMPARE(o->property("enumValue2").toInt(), 0); QCOMPARE(o->property("scopedEnumValue").toInt(), 2); QCOMPARE(o->property("enumValueFromSingleton").toInt(), 42); + // while this next test verifies current duplication behavior, I'm not sure it should be codified + QCOMPARE(o->property("duplicatedEnumValueFromSingleton").toInt(), 2); + QCOMPARE(o->property("scopedEnumValueFromSingleton1").toInt(), 43); + QCOMPARE(o->property("scopedEnumValueFromSingleton2").toInt(), 2); + QCOMPARE(o->property("scopedEnumValueFromSingleton3").toInt(), 2); } } |