summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp')
-rw-r--r--tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp
index 672b1f15a..c9481da3b 100644
--- a/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp
+++ b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp
@@ -137,7 +137,10 @@ void tst_QGraphicsTransform::rotation()
void tst_QGraphicsTransform::rotation3d()
{
QGraphicsRotation3D rotation;
- rotation.setOrigin(QPointF(10, 10));
+ QCOMPARE(rotation.axis().x(), (qreal)0);
+ QCOMPARE(rotation.axis().y(), (qreal)0);
+ QCOMPARE(rotation.axis().z(), (qreal)1);
+ QCOMPARE(rotation.angle(), (qreal)0);
QTransform t;
rotation.applyTo(&t);
@@ -147,6 +150,23 @@ void tst_QGraphicsTransform::rotation3d()
rotation.setAngle(180);
+ QTransform t180;
+ t180.rotate(180.0f);
+
+ QCOMPARE(t, QTransform());
+ QVERIFY(qFuzzyCompare(rotation.transform(), t180));
+
+ rotation.setAxis(QVector3D(0, 0, 0));
+ rotation.setOrigin(QPointF(10, 10));
+
+ t = QTransform();
+ rotation.applyTo(&t);
+
+ QCOMPARE(t, QTransform());
+ QCOMPARE(rotation.transform(), QTransform());
+
+ rotation.setAngle(180);
+
QCOMPARE(t, QTransform());
QCOMPARE(rotation.transform(), QTransform());