From df0001a3d62938c713b351c7e59228b803ec5670 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 27 Oct 2009 19:49:33 +0100 Subject: QFontMetrics test For commit b209ab1e2139cb5 --- tests/auto/qfontmetrics/tst_qfontmetrics.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp index 6b2f0fe..e80f8e0 100644 --- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp +++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp @@ -100,6 +100,20 @@ void tst_QFontMetrics::same() QFontMetrics fm(font); const QString text = QLatin1String("Some stupid STRING"); QCOMPARE(fm.size(0, text), fm.size(0, text)) ; + + { + QImage image; + QFontMetrics fm2(font, &image); + QString text2 = QLatin1String("Foo Foo"); + QCOMPARE(fm2.size(0, text2), fm2.size(0, text2)); //used to crash + } + + { + QImage image; + QFontMetricsF fm3(font, &image); + QString text2 = QLatin1String("Foo Foo"); + QCOMPARE(fm3.size(0, text2), fm3.size(0, text2)); //used to crash + } } -- cgit v0.12