summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-16 04:27:46 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-16 04:27:46 (GMT)
commit15e8301c3029646bfc2b78b821a0688ee7b287ae (patch)
tree0a0326d04691d2a40973443836dfc438bb5c1f98
parent341464cd84a72808e0cc8b2c3b28f1c0a7c5e43f (diff)
downloadQt-15e8301c3029646bfc2b78b821a0688ee7b287ae.zip
Qt-15e8301c3029646bfc2b78b821a0688ee7b287ae.tar.gz
Qt-15e8301c3029646bfc2b78b821a0688ee7b287ae.tar.bz2
Improve Qt.lighter()/darker() tests
-rw-r--r--tests/auto/declarative/qmlqt/data/darker.qml3
-rw-r--r--tests/auto/declarative/qmlqt/data/lighter.qml3
-rw-r--r--tests/auto/declarative/qmlqt/tst_qmlqt.cpp6
3 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlqt/data/darker.qml b/tests/auto/declarative/qmlqt/data/darker.qml
index 6369e8f..96ffa77 100644
--- a/tests/auto/declarative/qmlqt/data/darker.qml
+++ b/tests/auto/declarative/qmlqt/data/darker.qml
@@ -4,5 +4,8 @@ Object {
property var test1: Qt.darker(Qt.rgba(1, 0.8, 0.3))
property var test2: Qt.darker()
property var test3: Qt.darker(Qt.rgba(1, 0.8, 0.3), 10)
+ property var test4: Qt.darker("red");
+ property var test5: Qt.darker("perfectred"); // Non-existant color
+ property var test6: Qt.darker(10);
}
diff --git a/tests/auto/declarative/qmlqt/data/lighter.qml b/tests/auto/declarative/qmlqt/data/lighter.qml
index 6c888e7..2e9fdc8 100644
--- a/tests/auto/declarative/qmlqt/data/lighter.qml
+++ b/tests/auto/declarative/qmlqt/data/lighter.qml
@@ -4,4 +4,7 @@ Object {
property var test1: Qt.lighter(Qt.rgba(1, 0.8, 0.3))
property var test2: Qt.lighter()
property var test3: Qt.lighter(Qt.rgba(1, 0.8, 0.3), 10)
+ property var test4: Qt.lighter("red");
+ property var test5: Qt.lighter("perfectred"); // Non-existant color
+ property var test6: Qt.lighter(10);
}
diff --git a/tests/auto/declarative/qmlqt/tst_qmlqt.cpp b/tests/auto/declarative/qmlqt/tst_qmlqt.cpp
index 13f4904..4d09aee 100644
--- a/tests/auto/declarative/qmlqt/tst_qmlqt.cpp
+++ b/tests/auto/declarative/qmlqt/tst_qmlqt.cpp
@@ -213,6 +213,9 @@ void tst_qmlqt::lighter()
QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).lighter());
QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor());
QCOMPARE(qvariant_cast<QColor>(object->property("test3")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor("red").lighter());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor());
delete object;
}
@@ -226,6 +229,9 @@ void tst_qmlqt::darker()
QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).darker());
QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor());
QCOMPARE(qvariant_cast<QColor>(object->property("test3")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor("red").darker());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor());
delete object;
}