diff options
author | Sascha Kolewa <sascha.kolewa@nokia.com> | 2010-12-21 18:22:12 +0100 |
---|---|---|
committer | Sascha Kolewa <sascha.kolewa@nokia.com> | 2010-12-21 18:22:12 +0100 |
commit | d00f615cb43d93c9d8af468201c9e1373a02e380 (patch) | |
tree | 394a530270d00290482fc2ebda4234ae4070b7eb /tests/qmlauto/selftests/tst_compare_quickobjects.qml | |
parent | 23788e85d40f983d4be58789e0f979d4dd4cbbe4 (diff) |
Added test cases (also taken from http://philrathe.com)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"); + } +} |