aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Shalayel <sami.shalayel@qt.io>2023-09-07 09:48:48 +0200
committerSami Shalayel <sami.shalayel@qt.io>2023-09-11 14:28:10 +0200
commit3f31a8cbfd3c83a189db2581073b7b3c26303cec (patch)
tree4c52bba340ae8da0d07b5d5605b769f26a02f25f
parente33a63d0dec5dd7ebd8d3fc172de9d6e24ddf00f (diff)
fix tst_qqmllanguage:multiVersionSingletons
multiVersionSingletons expects some special type registration, which got overridden by "overrideSingleton", and therefore failed when running after the overrideSingleton test. Let multiVersionSingletons register its own type into a different module, to avoid clashes with other tests. Amends 4cdf0643b442a57b0cf0dcef104e71c0196dba06. Change-Id: Ieb8ff61666af296ef2a0e29cef4fcaa736dafc1f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r--tests/auto/qml/qqmllanguage/testtypes.cpp4
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp6
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/qml/qqmllanguage/testtypes.cpp b/tests/auto/qml/qqmllanguage/testtypes.cpp
index 8491d67520..b233903ca2 100644
--- a/tests/auto/qml/qqmllanguage/testtypes.cpp
+++ b/tests/auto/qml/qqmllanguage/testtypes.cpp
@@ -98,8 +98,8 @@ void registerTypes()
qmlRegisterType<ImmediateProperties>("Test", 1, 0, "ImmediateProperties");
qmlRegisterTypesAndRevisions<Extended, Foreign, ForeignExtended>("Test", 1);
- qmlRegisterTypesAndRevisions<BareSingleton>("Test", 11);
- qmlRegisterTypesAndRevisions<UncreatableSingleton>("Test", 11);
+ qmlRegisterTypesAndRevisions<BareSingleton>("Test", 1);
+ qmlRegisterTypesAndRevisions<UncreatableSingleton>("Test", 1);
// Metatype/namespace variation one: Register namespace first
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 9d2de837df..acbb21f2d6 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -8271,11 +8271,13 @@ void tst_qqmllanguage::callMethodOfAttachedDerived()
void tst_qqmllanguage::multiVersionSingletons()
{
+ qmlRegisterTypesAndRevisions<BareSingleton>("MultiVersionSingletons", 11);
+ qmlRegisterTypesAndRevisions<UncreatableSingleton>("MultiVersionSingletons", 11);
QQmlEngine engine;
for (const char *name : { "BareSingleton", "UncreatableSingleton"}) {
- const int id1 = qmlTypeId("Test", 1, 0, name);
- const int id2 = qmlTypeId("Test", 11, 0, name);
+ const int id1 = qmlTypeId("MultiVersionSingletons", 1, 0, name);
+ const int id2 = qmlTypeId("MultiVersionSingletons", 11, 0, name);
QVERIFY(id1 != id2);
const QJSValue value1 = engine.singletonInstance<QJSValue>(id1);
const QJSValue value2 = engine.singletonInstance<QJSValue>(id2);