summaryrefslogtreecommitdiffstats
path: root/tests/qmlauto/selftests/tst_compare_quickobjects.qml
blob: 99ead69c0d75fbfbbecf5015dfddca98b86715c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import Qt 4.7
import QtQuickTest 1.0

TestCase {
    name: "SelfTests_compare_QuickObjects"
    id: testParent

    Rectangle {
        id: item1
        color: "#000000"
    }
    Rectangle {
        id: item2
        color: "#000000"
    }
    Rectangle {
        id: item3
        color: "#ffffff"
    }

    Component {
        id: item4

        Rectangle {
            color: "#ffffff"
        }
    }

    function test_quickobjects() {
        compare(qtest_compareInternal(item1, item1), true, "Identical QtQuick instances");
        compare(qtest_compareInternal(item1, item3), false, "QtQuick instances with different properties");

        expectFail("", "Unsure if we want this.");
        compare(qtest_compareInternal(item1, item2), true, "QtQuick instances with same properties");

        expectFail("", "Unsure if we want this.");
        compare(qtest_compareInternal(item4.createObject(testParent),
                                      item4.createObject(testParent)), true, "QtQuick dynamic instances");
    }
}