diff options
author | Maurice Kalinowski <maurice.kalinowski@nokia.com> | 2009-04-08 08:20:14 (GMT) |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@nokia.com> | 2009-04-08 08:22:38 (GMT) |
commit | f13c24438b5baec0c11220a5d783fc6830d47aa3 (patch) | |
tree | 3b089851263be7ceb53c6793ab7e892051d802b4 /tests/auto/qline | |
parent | e2360b31d93e856945f030ea9526c5936ab62a8c (diff) | |
download | Qt-f13c24438b5baec0c11220a5d783fc6830d47aa3.zip Qt-f13c24438b5baec0c11220a5d783fc6830d47aa3.tar.gz Qt-f13c24438b5baec0c11220a5d783fc6830d47aa3.tar.bz2 |
fix assert
Reviewed-by: thartman
- in case we explicitly use double as testdata, one cannot push float to
it.
- fuzzyCompare is not fuzzy enough, thus adopt the epsilon check of
other testfunctions.
Diffstat (limited to 'tests/auto/qline')
-rw-r--r-- | tests/auto/qline/tst_qline.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qline/tst_qline.cpp b/tests/auto/qline/tst_qline.cpp index 932ec8e..ab0bd9b 100644 --- a/tests/auto/qline/tst_qline.cpp +++ b/tests/auto/qline/tst_qline.cpp @@ -201,8 +201,8 @@ void tst_QLine::testIntersection_data() b = b.translated(1, 1); QTest::newRow(qPrintable(QString::fromLatin1("rotation-%0").arg(i))) - << a.x1() << a.y1() << a.x2() << a.y2() - << b.x1() << b.y1() << b.x2() << b.y2() + << (double)a.x1() << (double)a.y1() << (double)a.x2() << (double)a.y2() + << (double)b.x1() << (double)b.y1() << (double)b.x2() << (double)b.y2() << int(QLineF::BoundedIntersection) << 1.0 << 1.0; @@ -232,8 +232,8 @@ void tst_QLine::testIntersection() QCOMPARE(int(itype), type); if (type != QLineF::NoIntersection) { - QCOMPARE(ip.x(), qreal(ix)); - QCOMPARE(ip.y(), qreal(iy)); + QVERIFY(qAbs(ip.x() - ix) < epsilon); + QVERIFY(qAbs(ip.y() - iy) < epsilon); } } |