@@ -30,28 +30,23 @@ TestCase {
30 id: testObject
30 id: testObject
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
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");
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");
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");
57 function test_undefined() {
52 function test_undefined() {