aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp')
-rw-r--r--tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp66
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;