-void tst_qqmlecmascript::singletonTypeConflicts1()
-{
- const char *warning = "Cannot register singleton type TypeName in uri Test.Conflict1 1.5 (a conflicting singleton type already exists)";
- QTest::ignoreMessage(QtWarningMsg, warning);
-
- int i0 = qmlRegisterSingletonType<testImportOrderApi>("Test.Conflict1", 1, 5, "TypeName", 0);
- QVERIFY(i0 != -1);
-
- int i1 = qmlRegisterSingletonType<testImportOrderApi>("Test.Conflict1", 2, 0, "TypeName", 0);
- QVERIFY(i1 != -1);
-
- int i2 = qmlRegisterSingletonType<testImportOrderApi>("Test.Conflict1", 1, 5, "TypeName", 0);
- QVERIFY(i2 == -1);
-
- int i3 = qmlRegisterSingletonType<testImportOrderApi>("Test.Conflict1", 1, 2, "TypeName", 0);
- QVERIFY(i3 != -1);
-
- int i4 = qmlRegisterSingletonType<testImportOrderApi>("Test.Conflict1", 1, 8, "TypeName", 0);
- QVERIFY(i4 != -1);
-}
-
-void tst_qqmlecmascript::singletonTypeConflicts2()
-{
- int i0 = qmlRegisterType<MyQmlObject>("Test.Conflict2", 1, 5, "TypeName");
- QVERIFY(i0 != -1);
-
- int i2 = qmlRegisterType<MyQmlObject>("Test.Conflict2", 1, 8, "TypeName");
- QVERIFY(i2 != -1);
-
- int i3 = qmlRegisterType<MyQmlObject>("Test.Conflict2", 2, 0, "TypeName");
- QVERIFY(i3 != -1);
-
- int i4 = qmlRegisterSingletonType<testImportOrderApi>("Test.Conflict2", 1, 0, "TypeName", 0);
- QVERIFY(i4 != -1);
-
- const char *warning2 = "Cannot register singleton type TypeName in uri Test.Conflict2 1.9 (a conflicting type already exists)";
- QTest::ignoreMessage(QtWarningMsg, warning2);
-
- int i5 = qmlRegisterSingletonType<testImportOrderApi>("Test.Conflict2", 1, 9, "TypeName", 0);
- QVERIFY(i5 == -1);
-}
-
-void tst_qqmlecmascript::singletonTypeConflicts3()
-{
- int i0 = qmlRegisterSingletonType<testImportOrderApi>("Test.Conflict3", 1, 0, "TypeName", 0);
- QVERIFY(i0 != -1);
-
- int i1 = qmlRegisterSingletonType<testImportOrderApi>("Test.Conflict3", 1, 5, "TypeName", 0);
- QVERIFY(i1 != -1);
-
- int i2 = qmlRegisterSingletonType<testImportOrderApi>("Test.Conflict3", 1, 8, "TypeName", 0);
- QVERIFY(i2 != -1);
-
- int i3 = qmlRegisterSingletonType<testImportOrderApi>("Test.Conflict3", 2, 0, "TypeName", 0);
- QVERIFY(i3 != -1);
-
- const char *warning = "Cannot register type TypeName in uri Test.Conflict3 1.0 (a conflicting singleton type already exists)";
- QTest::ignoreMessage(QtWarningMsg, warning);
-
- int i4 = qmlRegisterType<MyQmlObject>("Test.Conflict3", 1, 0, "TypeName");
- QVERIFY(i4 == -1);
-
- int i5 = qmlRegisterType<MyQmlObject>("Test.Conflict3", 1, 3, "TypeName");
- QVERIFY(i5 != -1);
-}
-