diff options
author | Sascha Kolewa <sascha.kolewa@nokia.com> | 2011-01-10 12:30:24 +0100 |
---|---|---|
committer | Sascha Kolewa <sascha.kolewa@nokia.com> | 2011-01-10 12:30:24 +0100 |
commit | 83576c0166a322bf3e8825a09aa46db480eb7509 (patch) | |
tree | 87c2e7c56ffa8a7e8917f5fdcca8235b170c22d4 /tests/qmlauto/selftests/tst_compare_quickobjects.qml | |
parent | e59bd7d548882dd2802721ecd88f4e9a42c92af6 (diff) | |
parent | d00f615cb43d93c9d8af468201c9e1373a02e380 (diff) |
Merge branch 'Extend_compare_for_objects_and_arrays'
Diffstat (limited to 'tests/qmlauto/selftests/tst_compare_quickobjects.qml')
-rw-r--r-- | tests/qmlauto/selftests/tst_compare_quickobjects.qml | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/qmlauto/selftests/tst_compare_quickobjects.qml b/tests/qmlauto/selftests/tst_compare_quickobjects.qml new file mode 100644 index 0000000..99ead69 --- /dev/null +++ b/tests/qmlauto/selftests/tst_compare_quickobjects.qml @@ -0,0 +1,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"); + } +} |