From 15e8301c3029646bfc2b78b821a0688ee7b287ae Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 16 Nov 2009 14:27:46 +1000 Subject: Improve Qt.lighter()/darker() tests --- tests/auto/declarative/qmlqt/data/darker.qml | 3 +++ tests/auto/declarative/qmlqt/data/lighter.qml | 3 +++ tests/auto/declarative/qmlqt/tst_qmlqt.cpp | 6 ++++++ 3 files changed, 12 insertions(+) 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(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).lighter()); QCOMPARE(qvariant_cast(object->property("test2")), QColor()); QCOMPARE(qvariant_cast(object->property("test3")), QColor()); + QCOMPARE(qvariant_cast(object->property("test4")), QColor("red").lighter()); + QCOMPARE(qvariant_cast(object->property("test5")), QColor()); + QCOMPARE(qvariant_cast(object->property("test6")), QColor()); delete object; } @@ -226,6 +229,9 @@ void tst_qmlqt::darker() QCOMPARE(qvariant_cast(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).darker()); QCOMPARE(qvariant_cast(object->property("test2")), QColor()); QCOMPARE(qvariant_cast(object->property("test3")), QColor()); + QCOMPARE(qvariant_cast(object->property("test4")), QColor("red").darker()); + QCOMPARE(qvariant_cast(object->property("test5")), QColor()); + QCOMPARE(qvariant_cast(object->property("test6")), QColor()); delete object; } -- cgit v0.12