summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-07-12 07:32:40 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-07-12 07:32:40 (GMT)
commit9a79b2bccba4ac80ab7b5d13d7ad3651bde06893 (patch)
tree84b599027bb34cdce1443adf78def8f305764fb5 /tests
parent978e22d6529d7cbe9472749352d632eefd22cd07 (diff)
parent1571281bc0839cf504ac7692050ef4fe61532470 (diff)
downloadQt-9a79b2bccba4ac80ab7b5d13d7ad3651bde06893.zip
Qt-9a79b2bccba4ac80ab7b5d13d7ad3651bde06893.tar.gz
Qt-9a79b2bccba4ac80ab7b5d13d7ad3651bde06893.tar.bz2
Merge remote branch 'review/master' into staging
Diffstat (limited to 'tests')
-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 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"