aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>2010-09-27 18:28:31 +0300
committerPekka Vuorela <pekka.ta.vuorela@nokia.com>2010-09-27 18:28:31 +0300
commit3fed9dc28812ba5b94721da2c44f505ae82ccb67 (patch)
tree665a90cfdcfcf1c6942afd54a56b838ab154367b
parent8c91fce265d2d96becf45d281123eb90c8a58699 (diff)
Changes: fix invalid use of QCOMPARE in texteditview test
RevBy: TrustMe
-rw-r--r--tests/ut_mtexteditview/ut_mtexteditview.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/ut_mtexteditview/ut_mtexteditview.cpp b/tests/ut_mtexteditview/ut_mtexteditview.cpp
index 8cb43ec0..58966461 100644
--- a/tests/ut_mtexteditview/ut_mtexteditview.cpp
+++ b/tests/ut_mtexteditview/ut_mtexteditview.cpp
@@ -208,7 +208,8 @@ void Ut_MTextEditView::testUpdateScrollWhenTextChanged()
QKeyEvent event(QEvent::KeyPress, Qt::Key_X, Qt::NoModifier, "x");
// test for bug #150452
- QCOMPARE(m_subject->d_ptr->hscroll, qreal(0));
+ // (note: QCOMPARE doesn't know how to properly compare two zero floats)
+ QVERIFY(qAbs(m_subject->d_ptr->hscroll) < 0.01);
for (int n = 0; n < count; ++n) {
m_controller->keyPressEvent(&event);
}
@@ -219,12 +220,12 @@ void Ut_MTextEditView::testUpdateScrollWhenTextChanged()
m_controller->keyPressEvent(&bsEvent);
}
QVERIFY(hscroll > m_subject->d_ptr->hscroll);
- QCOMPARE(m_subject->d_ptr->hscroll, qreal(0));
+ QVERIFY(qAbs(m_subject->d_ptr->hscroll) < 0.01);
while (!m_controller->text().isEmpty()) {
m_controller->keyPressEvent(&bsEvent);
}
- QCOMPARE(m_subject->d_ptr->hscroll, qreal(0));
+ QVERIFY(qAbs(m_subject->d_ptr->hscroll) < 0.01);
// test for bug #177305
for (int n = 0; n < count; ++n) {