diff options
author | Marco Bubke <marco.bubke@digia.com> | 2012-10-22 17:57:05 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-23 13:24:54 +0200 |
commit | 3e9caba478695443669ff880334ea69db6f764eb (patch) | |
tree | f555cc9e454241b4d10fbeeb9f3ee1ddb29868de /tests/auto/qml | |
parent | 85fd1c48f32c266168c2e3d8195f81e59a7dc5e6 (diff) |
Change qml list interface
Change-Id: I185c6f4cef6105544504324c1616b5995c219fe3
Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
Diffstat (limited to 'tests/auto/qml')
-rw-r--r-- | tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp index 028eb30f53..68f4553921 100644 --- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp +++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp @@ -68,6 +68,8 @@ private slots: void canAt(); void canClear(); void canCount(); + void isReadable(); + void isManipulable(); void append(); void at(); void clear(); @@ -128,6 +130,8 @@ void tst_qqmllistreference::qmllistreference_invalid() QVERIFY(r.at(10) == 0); QVERIFY(r.clear() == false); QVERIFY(r.count() == 0); + QVERIFY(r.isReadable() == false); + QVERIFY(r.isManipulable() == false); } // Non-property @@ -143,6 +147,8 @@ void tst_qqmllistreference::qmllistreference_invalid() QVERIFY(r.at(10) == 0); QVERIFY(r.clear() == false); QVERIFY(r.count() == 0); + QVERIFY(r.isReadable() == false); + QVERIFY(r.isManipulable() == false); } // Non-list property @@ -158,6 +164,8 @@ void tst_qqmllistreference::qmllistreference_invalid() QVERIFY(r.at(10) == 0); QVERIFY(r.clear() == false); QVERIFY(r.count() == 0); + QVERIFY(r.isReadable() == false); + QVERIFY(r.isManipulable() == false); } } @@ -343,6 +351,64 @@ void tst_qqmllistreference::canCount() } } +void tst_qqmllistreference::isReadable() +{ + TestType *tt = new TestType; + + { + QQmlListReference ref; + QVERIFY(ref.isReadable() == false); + } + + { + QQmlListReference ref(tt, "blah"); + QVERIFY(ref.isReadable() == false); + } + + { + QQmlListReference ref(tt, "data"); + QVERIFY(ref.isReadable() == true); + delete tt; + QVERIFY(ref.isReadable() == false); + } + + { + TestType tt; + tt.property.count = 0; + QQmlListReference ref(&tt, "data"); + QVERIFY(ref.isReadable() == false); + } +} + +void tst_qqmllistreference::isManipulable() +{ + TestType *tt = new TestType; + + { + QQmlListReference ref; + QVERIFY(ref.isManipulable() == false); + } + + { + QQmlListReference ref(tt, "blah"); + QVERIFY(ref.isManipulable() == false); + } + + { + QQmlListReference ref(tt, "data"); + QVERIFY(ref.isManipulable() == true); + delete tt; + QVERIFY(ref.isManipulable() == false); + } + + { + TestType tt; + tt.property.count = 0; + QQmlListReference ref(&tt, "data"); + QVERIFY(ref.isManipulable() == false); + } +} + void tst_qqmllistreference::append() { TestType *tt = new TestType; |