diff options
author | Water-Team <water@pad.test.qt.nokia.com> | 2011-07-13 23:00:14 (GMT) |
---|---|---|
committer | Water-Team <water@pad.test.qt.nokia.com> | 2011-07-13 23:00:14 (GMT) |
commit | 6da7e168c2caebd8164d7b69e74c2b9ded999dd7 (patch) | |
tree | 4f176ef44294371ef45f48b7e2eae441711e51c1 /tests | |
parent | eff5ecc5d8f65fa25d6cfd6ed96a9d2a00d0c663 (diff) | |
parent | 80b91ac5f579b5cc310366fb0ea4aa4c813c04bf (diff) | |
download | Qt-6da7e168c2caebd8164d7b69e74c2b9ded999dd7.zip Qt-6da7e168c2caebd8164d7b69e74c2b9ded999dd7.tar.gz Qt-6da7e168c2caebd8164d7b69e74c2b9ded999dd7.tar.bz2 |
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qpainterpath/tst_qpainterpath.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qpainterpath/tst_qpainterpath.cpp b/tests/auto/qpainterpath/tst_qpainterpath.cpp index 3941a11..33315ad 100644 --- a/tests/auto/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/qpainterpath/tst_qpainterpath.cpp @@ -114,6 +114,8 @@ private slots: void connectPathMoveTo(); void translate(); + + void lineWithinBounds(); }; // Testing get/set functions @@ -1306,6 +1308,25 @@ void tst_QPainterPath::translate() QCOMPARE(complexPath.translated(-offset), untranslatedComplexPath); } + +void tst_QPainterPath::lineWithinBounds() +{ + const int iteration_count = 3; + volatile const qreal yVal = 0.5; + QPointF a(0.0, yVal); + QPointF b(1000.0, yVal); + QPointF c(2000.0, yVal); + QPointF d(3000.0, yVal); + QPainterPath path; + path.moveTo(QPointF(0, yVal)); + path.cubicTo(QPointF(1000.0, yVal), QPointF(2000.0, yVal), QPointF(3000.0, yVal)); + for(int i=0; i<=iteration_count; i++) { + qreal actual = path.pointAtPercent(qreal(i) / iteration_count).y(); + QVERIFY(actual == yVal); // don't use QCOMPARE, don't want fuzzy comparison + } +} + + QTEST_APPLESS_MAIN(tst_QPainterPath) #include "tst_qpainterpath.moc" |