diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-11-04 04:16:12 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-11-04 04:16:12 (GMT) |
commit | 47889bd63d8a14b10984576998a69d8a4cd0a8d0 (patch) | |
tree | a20f8e7b3b0b19de5c68f1d1103a77caf2d17936 /tests/auto/declarative/qmlqt | |
parent | 2c6d4485b7a0c8c819a225e56ca9a43ab4fcccf4 (diff) | |
parent | 684fe7af0b6d8133973132fd5b6b01cc16957a10 (diff) | |
download | Qt-47889bd63d8a14b10984576998a69d8a4cd0a8d0.zip Qt-47889bd63d8a14b10984576998a69d8a4cd0a8d0.tar.gz Qt-47889bd63d8a14b10984576998a69d8a4cd0a8d0.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto/declarative/qmlqt')
-rw-r--r-- | tests/auto/declarative/qmlqt/data/closestangle.qml | 12 | ||||
-rw-r--r-- | tests/auto/declarative/qmlqt/tst_qmlqt.cpp | 18 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlqt/data/closestangle.qml b/tests/auto/declarative/qmlqt/data/closestangle.qml new file mode 100644 index 0000000..8f999e3 --- /dev/null +++ b/tests/auto/declarative/qmlqt/data/closestangle.qml @@ -0,0 +1,12 @@ +import Qt 4.6 + +Object { + property var testSame: Qt.closestAngle(0,1) + property var testLess: Qt.closestAngle(0,-359) + property var testMore: Qt.closestAngle(0,361) + property var testFail: Qt.closestAngle(0) + property var test5: Qt.closestAngle(0,1,2) + property var test6: Qt.closestAngle(123.45465768,1.11) + property var test7: Qt.closestAngle(-3.1415,1.11) +} + diff --git a/tests/auto/declarative/qmlqt/tst_qmlqt.cpp b/tests/auto/declarative/qmlqt/tst_qmlqt.cpp index 10402ae..cc9b94d 100644 --- a/tests/auto/declarative/qmlqt/tst_qmlqt.cpp +++ b/tests/auto/declarative/qmlqt/tst_qmlqt.cpp @@ -64,6 +64,7 @@ private slots: void lighter(); void darker(); void tint(); + void closestAngle(); void playSound(); void openUrlExternally(); @@ -249,6 +250,23 @@ void tst_qmlqt::tint() delete object; } +void tst_qmlqt::closestAngle() +{ + QmlComponent component(&engine, TEST_FILE("closestangle.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(qvariant_cast<qreal>(object->property("testSame")), 1.0); + QCOMPARE(qvariant_cast<qreal>(object->property("testLess")), 1.0); + QCOMPARE(qvariant_cast<qreal>(object->property("testMore")), 1.0); + QCOMPARE(qvariant_cast<qreal>(object->property("testFail")), 0.0); + QCOMPARE(qvariant_cast<qreal>(object->property("test5")), 1.0); + QCOMPARE(qvariant_cast<qreal>(object->property("test6")), 1.11); + QCOMPARE(qvariant_cast<qreal>(object->property("test7")), 1.11); + + delete object; +} + void tst_qmlqt::playSound() { QEXPECT_FAIL("", "How do we test this?", Abort); |