on xenial help sign in
Singleton bug is fixed.
145d33bMichał Sawicz
tests/qmltests/utils/Unity/Test/tst_UnityTest.qml+3−8
@@ -30,28 +30,23 @@ TestCase {
30 id: testObject
30 id: testObject
31 }
31 }
32
32
33− // Singletons need to be bound to a property and not-named-imported
34− // for them to be able to be properly passed back to C++.
35− // See https://bugreports.qt-project.org/browse/QTBUG-30730
36− property var util: Util
37−
38 function test_direct() {
33 function test_direct() {
39 compare(Util.isInstanceOf(rect, "QQuickRectangle"), true, "rect should be an instance of QQuickRectangle");
34 compare(Util.isInstanceOf(rect, "QQuickRectangle"), true, "rect should be an instance of QQuickRectangle");
40− compare(Util.isInstanceOf(util, "TestUtil"), true, "Util should be an instance of TestUtil");
35+ compare(Util.isInstanceOf(Util, "TestUtil"), true, "Util should be an instance of TestUtil");
41 compare(Util.isInstanceOf(testObject, "MockObjectForInstanceOfTestChild"), true, "testObject should be an instance of MockObjectForInstanceOfTestChild");
36 compare(Util.isInstanceOf(testObject, "MockObjectForInstanceOfTestChild"), true, "testObject should be an instance of MockObjectForInstanceOfTestChild");
42 }
37 }
43
38
44 function test_inherited() {
39 function test_inherited() {
45 compare(Util.isInstanceOf(rect, "QQuickItem"), true, "rect should be an instance of QQuickItem");
40 compare(Util.isInstanceOf(rect, "QQuickItem"), true, "rect should be an instance of QQuickItem");
46 compare(Util.isInstanceOf(rect, "QObject"), true, "rect should be an instance of QObject");
41 compare(Util.isInstanceOf(rect, "QObject"), true, "rect should be an instance of QObject");
47− compare(Util.isInstanceOf(util, "QObject"), true, "Util should be an instance of QObject");
42+ compare(Util.isInstanceOf(Util, "QObject"), true, "Util should be an instance of QObject");
48 compare(Util.isInstanceOf(testObject, "MockObjectForInstanceOfTest"), true, "testObject should be an instance of MockObjectForInstanceOfTest");
43 compare(Util.isInstanceOf(testObject, "MockObjectForInstanceOfTest"), true, "testObject should be an instance of MockObjectForInstanceOfTest");
49 compare(Util.isInstanceOf(testObject, "QQuickRectangle"), true, "testObject should be an instance of QQuickRectangle");
44 compare(Util.isInstanceOf(testObject, "QQuickRectangle"), true, "testObject should be an instance of QQuickRectangle");
50 }
45 }
51
46
52 function test_negative() {
47 function test_negative() {
53 compare(Util.isInstanceOf(rect, "QQuickMouseArea"), false, "rect should not be an instance of MouseArea");
48 compare(Util.isInstanceOf(rect, "QQuickMouseArea"), false, "rect should not be an instance of MouseArea");
54− compare(Util.isInstanceOf(util, "QQuickItem"), false, "Util should not be an instance of QQuickItem");
49+ compare(Util.isInstanceOf(Util, "QQuickItem"), false, "Util should not be an instance of QQuickItem");
55 }
50 }
56
51
57 function test_undefined() {
52 function test_undefined() {