summaryrefslogtreecommitdiffstats
path: root/tests/auto/qfontcombobox
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-12-01 09:35:54 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-12-01 09:43:19 (GMT)
commit4bb7bacccff707a693de6d50c7ce886126b68c25 (patch)
treede1c652674f7f373f3f07197755ea3e4d1b26c16 /tests/auto/qfontcombobox
parent3c1c84dd569c02bfeec66aa985616b654b69a531 (diff)
downloadQt-4bb7bacccff707a693de6d50c7ce886126b68c25.zip
Qt-4bb7bacccff707a693de6d50c7ce886126b68c25.tar.gz
Qt-4bb7bacccff707a693de6d50c7ce886126b68c25.tar.bz2
Fix QFontCombobox autotest on X11
On X11, Font might have a foundry within bracket. This foundry is set by the font combobox, and makes the font comparison fail. Make sure the other attributes (size, bold, ...) are preserved when the font is changed. Reviewed-by: Gabriel
Diffstat (limited to 'tests/auto/qfontcombobox')
-rw-r--r--tests/auto/qfontcombobox/tst_qfontcombobox.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/qfontcombobox/tst_qfontcombobox.cpp b/tests/auto/qfontcombobox/tst_qfontcombobox.cpp
index b974ecab..657be06 100644
--- a/tests/auto/qfontcombobox/tst_qfontcombobox.cpp
+++ b/tests/auto/qfontcombobox/tst_qfontcombobox.cpp
@@ -144,9 +144,11 @@ void tst_QFontComboBox::currentFont()
QFont oldCurrentFont = box.currentFont();
box.setCurrentFont(currentFont);
- QCOMPARE(box.currentFont(), currentFont);
- QString boxFontFamily = QFontInfo(box.currentFont()).family();
QRegExp foundry(" \\[.*\\]");
+ if (!box.currentFont().family().contains(foundry)) {
+ QCOMPARE(box.currentFont(), currentFont);
+ }
+ QString boxFontFamily = QFontInfo(box.currentFont()).family();
if (!currentFont.family().contains(foundry))
boxFontFamily.remove(foundry);
QCOMPARE(boxFontFamily, currentFont.family());