diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-07-12 21:06:54 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-07-12 21:06:54 (GMT) |
commit | c3b6b687e340d4d0c65789c3ac80dbaf2eb513b5 (patch) | |
tree | 56a76d96b33eee16eea7f5ea475d4991167070ef /tests | |
parent | 647c618da0024373fd866999e7603cbf36cc855e (diff) | |
parent | 9a79b2bccba4ac80ab7b5d13d7ad3651bde06893 (diff) | |
download | Qt-c3b6b687e340d4d0c65789c3ac80dbaf2eb513b5.zip Qt-c3b6b687e340d4d0c65789c3ac80dbaf2eb513b5.tar.gz Qt-c3b6b687e340d4d0c65789c3ac80dbaf2eb513b5.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging:
Fix compiler warning in qtextdocument.cpp
Fix crash when app font is added
Use truncate only for subpixel boundingBox x position
Use more numerically robust algorithm to compute QBezier::pointAt().
Fix editable combobox style on Mac
Revert 344a4dcfe and part of 93bce787
Fix raster subpixel positioning in Lion
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" |