Merge master <-> api_changes
[profile/ivi/qtdeclarative.git] / tests / auto / qml / v4 / tst_v4.cpp
index 559abf7..4e3e71f 100644 (file)
@@ -45,6 +45,7 @@
 #include <QtQml/qqmlengine.h>
 #include <QtQml/qqmlcomponent.h>
 #include <QtCore/qdebug.h>
+#include <QtGui/qcolor.h>
 
 #include <private/qv4compiler_p.h>
 
@@ -73,6 +74,7 @@ private slots:
     void stringComparison();
     void unaryMinus();
     void unaryPlus();
+    void colorType();
 
 private:
     QQmlEngine engine;
@@ -348,6 +350,22 @@ void tst_v4::unaryPlus()
     delete o;
 }
 
+void tst_v4::colorType()
+{
+    QQmlComponent component(&engine, testFileUrl("colorType.qml"));
+
+    QObject *o = component.create();
+    QVERIFY(o != 0);
+    QCOMPARE(o->property("test1").value<QColor>(), QColor("red"));
+    QCOMPARE(o->property("test2").value<QColor>(), QColor("red"));
+    QCOMPARE(o->property("test3").value<QColor>(), QColor("red"));
+    QCOMPARE(o->property("test4").toBool(), true);
+    QCOMPARE(o->property("test5").toBool(), true);
+    QCOMPARE(o->property("test6").toBool(), true);
+    QCOMPARE(o->property("test7").toBool(), true);
+    delete o;
+}
+
 QTEST_MAIN(tst_v4)
 
 #include "tst_v4.moc"