From b8f7adab5a146bea04d598299c04570fe95caedc Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Tue, 5 Jan 2010 13:24:44 +0100 Subject: Make unit test more robust Make sure that on systems that have a default font of "Sans Serif" (or another not really existing font name) the unit test doesn't fail. Reviewed-By: Simon Hausmann Reviewed-By: Olivier --- tests/auto/qfontcombobox/tst_qfontcombobox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/qfontcombobox/tst_qfontcombobox.cpp b/tests/auto/qfontcombobox/tst_qfontcombobox.cpp index 657be06..73dfe076 100644 --- a/tests/auto/qfontcombobox/tst_qfontcombobox.cpp +++ b/tests/auto/qfontcombobox/tst_qfontcombobox.cpp @@ -123,9 +123,11 @@ void tst_QFontComboBox::currentFont_data() QTest::addColumn("currentFont"); // Normalize the names QFont defaultFont; + QFontInfo fi(defaultFont); + defaultFont = QFont(fi.family()); // make sure we have a real font name and not something like 'Sans Serif'. QTest::newRow("default") << defaultFont; defaultFont.setPointSize(defaultFont.pointSize() + 10); - QTest::newRow("default") << defaultFont; + QTest::newRow("default2") << defaultFont; QFontDatabase db; QStringList list = db.families(); for (int i = 0; i < list.count(); ++i) { -- cgit v0.12