summaryrefslogtreecommitdiffstats
path: root/tests/auto/qfontmetrics
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-10 10:17:26 +0200
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-10 11:05:13 +0200
commitb8d44332bbbca1d065a07cba79ad179bd9c0197c (patch)
tree03bfe563238dc13cba07efb67f4f83594cdfe86d /tests/auto/qfontmetrics
parent53b4b458982fd9520ac710843fd5b68780adf159 (diff)
Stabilize some tests.
For the QFontMetrics test, the different way of computing the with of a text returs different value (1 to 2 pixel difference). So we need to make sure to use the same way to compute the with that the one used to ellide.
Diffstat (limited to 'tests/auto/qfontmetrics')
-rw-r--r--tests/auto/qfontmetrics/tst_qfontmetrics.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
index 665107aacf..6b2f0fed64 100644
--- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
@@ -211,11 +211,11 @@ void tst_QFontMetrics::elidedMultiLength()
QString text1_short = "Shorter";
QString text1_small = "small";
QFontMetrics fm = QFontMetrics(QFont());
- int width_long = fm.boundingRect(text1_long).width();
+ int width_long = fm.size(0, text1_long).width();
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, 8000), text1_long);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long + 1), text1_long);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long - 1), text1_short);
- int width_short = fm.boundingRect(text1_short).width();
+ int width_short = fm.size(0, text1_short).width();
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short + 1), text1_short);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short - 1), text1_small);