aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlvaluetypes
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-03-05 11:39:24 +1000
committerMatthew Vogt <matthew.vogt@nokia.com>2012-03-05 11:39:54 +1000
commit0284817d6cd7e17afa8da26ee6e9199100754446 (patch)
treec351d55d5a606c81c72e481f846b9b9e2603c883 /tests/auto/qml/qqmlvaluetypes
parent377eb94eb19dafeca20d12bc6b624f1779fae514 (diff)
parent36bd7f616f37f5f60e59bce1f0d8970248d627de (diff)
Merge master <-> api_changes
Diffstat (limited to 'tests/auto/qml/qqmlvaluetypes')
-rw-r--r--tests/auto/qml/qqmlvaluetypes/data/nonValueTypeComparison.qml10
-rw-r--r--tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp17
2 files changed, 25 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmlvaluetypes/data/nonValueTypeComparison.qml b/tests/auto/qml/qqmlvaluetypes/data/nonValueTypeComparison.qml
new file mode 100644
index 0000000000..0ffa5eb666
--- /dev/null
+++ b/tests/auto/qml/qqmlvaluetypes/data/nonValueTypeComparison.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.0
+
+Item {
+ property variant somepoint: Qt.point(1,2)
+ property variant randomjsobj: {"some": 1, "thing": 2}
+ property bool test1: somepoint != randomjsobj
+
+ property variant similar: {"x":1, "y":2}
+ property bool test2: somepoint != similar
+}
diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
index 695dbe4147..0aa223e733 100644
--- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
+++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
@@ -93,6 +93,7 @@ private slots:
void returnValues();
void varAssignment();
void bindingsSpliceCorrectly();
+ void nonValueTypeComparison();
private:
QQmlEngine engine;
@@ -950,7 +951,6 @@ void tst_qqmlvaluetypes::autoBindingRemoval()
delete object;
}
- /*
{
QQmlComponent component(&engine, testFileUrl("autoBindingRemoval.2.qml"));
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
@@ -975,6 +975,8 @@ void tst_qqmlvaluetypes::autoBindingRemoval()
{
QQmlComponent component(&engine, testFileUrl("autoBindingRemoval.3.qml"));
+ QString warning = component.url().toString() + ":6: Unable to assign [undefined] to QRect";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
QVERIFY(object != 0);
@@ -992,7 +994,6 @@ void tst_qqmlvaluetypes::autoBindingRemoval()
delete object;
}
-*/
}
// Test that property value sources assign to value types
@@ -1301,6 +1302,18 @@ void tst_qqmlvaluetypes::bindingsSpliceCorrectly()
}
}
+void tst_qqmlvaluetypes::nonValueTypeComparison()
+{
+ QQmlComponent component(&engine, testFileUrl("nonValueTypeComparison.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toBool(), true);
+ QCOMPARE(object->property("test2").toBool(), true);
+
+ delete object;
+}
+
QTEST_MAIN(tst_qqmlvaluetypes)
#include "tst_qqmlvaluetypes.moc"