summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpainterpath/tst_qpainterpath.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2011-08-25 12:50:29 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-25 12:50:29 +0200
commit9e04c60ac070348f8208fb0254e62d6e593320c3 (patch)
treecd038cf2612faf8dadeae5fb8b807b66e2291026 /tests/auto/qpainterpath/tst_qpainterpath.cpp
parentbfa8d15e15fdeb0bbfb6575e37be1c32445ab7cc (diff)
parent04d0a9626ce61b2e05a40f9562c2bcf12e234639 (diff)
Merge "Merge branch 'master' into refactor" into refactor
Diffstat (limited to 'tests/auto/qpainterpath/tst_qpainterpath.cpp')
-rw-r--r--tests/auto/qpainterpath/tst_qpainterpath.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qpainterpath/tst_qpainterpath.cpp b/tests/auto/qpainterpath/tst_qpainterpath.cpp
index 3941a11460..33315adc06 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"