diff options
Diffstat (limited to 'tests/auto/quick/qquickflipable/tst_qquickflipable.cpp')
-rw-r--r-- | tests/auto/quick/qquickflipable/tst_qquickflipable.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp b/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp index 7106041eda..55747a7cdd 100644 --- a/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp +++ b/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp @@ -52,6 +52,9 @@ private slots: void QTBUG_9161_crash(); void QTBUG_8474_qgv_abort(); + void flipRotationAngle_data(); + void flipRotationAngle(); + private: QQmlEngine engine; }; @@ -137,6 +140,31 @@ void tst_qquickflipable::QTBUG_8474_qgv_abort() delete window; } +void tst_qquickflipable::flipRotationAngle_data() +{ + QTest::addColumn<int>("angle"); + QTest::addColumn<QQuickFlipable::Side>("side"); + + QTest::newRow("89") << 89 << QQuickFlipable::Front; + QTest::newRow("91") << 91 << QQuickFlipable::Back; + QTest::newRow("-89") << -89 << QQuickFlipable::Front; + QTest::newRow("-91") << -91 << QQuickFlipable::Back; +} + +void tst_qquickflipable::flipRotationAngle() // QTBUG-75954 +{ + QFETCH(int, angle); + QFETCH(QQuickFlipable::Side, side); + + QQmlEngine engine; + QQmlComponent c(&engine, testFileUrl("flip-y-axis-flipable.qml")); + QQuickFlipable *obj = qobject_cast<QQuickFlipable*>(c.create()); + QVERIFY(obj != nullptr); + obj->setProperty("angle", angle); + QCOMPARE(obj->side(), side); + delete obj; +} + QTEST_MAIN(tst_qquickflipable) #include "tst_qquickflipable.moc" |