summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/styles
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-03-09 11:06:18 +0200
committerQt by Nokia <qt-info@nokia.com>2012-03-09 16:54:27 +0100
commit7c89d44d95c1c91f77aca3359cd8964a354fc41c (patch)
tree82cb2ff2b629091da4f215644820adedbd3e6535 /tests/auto/widgets/styles
parent46e51ce1dd17aedc34acbf5e80f824025877afaf (diff)
Windows: Fix QStyleSheetStyle autotest antialiasing issues
Antialiasing of fonts was causing two tests that relied on finding at least a certain number of pixels of certain color to find one or two too few pixels of that color and thus fail. Fixed by increasing the amount of text displayed to make sure enough pixels of correct color would be present. Also removing the test insignification, as the test will now pass completely when run under Windows Classic theme, which CI uses. Task-number: QTBUG-24323 Change-Id: Ic0b614d33e4e4f5df18d53cb72a05db5d8b6b5e7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests/auto/widgets/styles')
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro2
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp30
2 files changed, 18 insertions, 14 deletions
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro b/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
index dd17183b30..c96004bd5d 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
+++ b/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
@@ -6,5 +6,3 @@ SOURCES += tst_qstylesheetstyle.cpp
RESOURCES += resources.qrc
requires(contains(QT_CONFIG,private_tests))
-
-win32:CONFIG += insignificant_test # QTBUG-24323
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 544923a1c3..3bff332252 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -728,22 +728,27 @@ void tst_QStyleSheetStyle::focusColors()
// is reached if at least ten pixels of the right color can be found in
// the image.
// For this reason, we use unusual and extremely ugly colors! :-)
+ // Note that in case of anti-aliased text, ensuring that we have at least
+ // ten pixels of the right color requires quite a many characters, as the
+ // majority of the pixels will have slightly different colors due to the
+ // anti-aliasing effect.
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC) && !(defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(Q_CC_INTEL))
QSKIP("This is a fragile test which fails on many esoteric platforms because of focus problems. "
"That doesn't mean that the feature doesn't work in practice.");
#endif
QList<QWidget *> widgets;
- widgets << new QPushButton("TESTING");
- widgets << new QLineEdit("TESTING");
- widgets << new QLabel("TESTING");
+ widgets << new QPushButton("TESTING TESTING");
+ widgets << new QLineEdit("TESTING TESTING");
+ widgets << new QLabel("TESTING TESTING");
QSpinBox *spinbox = new QSpinBox;
- spinbox->setValue(8888);
+ spinbox->setMaximum(1000000000);
+ spinbox->setValue(123456789);
widgets << spinbox;
QComboBox *combobox = new QComboBox;
combobox->setEditable(true);
- combobox->addItems(QStringList() << "TESTING");
+ combobox->addItems(QStringList() << "TESTING TESTING");
widgets << combobox;
- widgets << new QLabel("TESTING");
+ widgets << new QLabel("TESTING TESTING");
#ifdef Q_WS_QWS
// QWS has its own special focus logic which is slightly different
@@ -794,17 +799,18 @@ void tst_QStyleSheetStyle::hoverColors()
if (!PlatformQuirks::haveMouseCursor())
QSKIP("No mouse Cursor on this platform");
QList<QWidget *> widgets;
- widgets << new QPushButton("TESTING");
- widgets << new QLineEdit("TESTING");
- widgets << new QLabel("TESTING");
+ widgets << new QPushButton("TESTING TESTING");
+ widgets << new QLineEdit("TESTING TESTING");
+ widgets << new QLabel("TESTING TESTING");
QSpinBox *spinbox = new QSpinBox;
- spinbox->setValue(8888);
+ spinbox->setMaximum(1000000000);
+ spinbox->setValue(123456789);
widgets << spinbox;
QComboBox *combobox = new QComboBox;
combobox->setEditable(true);
- combobox->addItems(QStringList() << "TESTING");
+ combobox->addItems(QStringList() << "TESTING TESTING");
widgets << combobox;
- widgets << new QLabel("<b>TESTING</b>");
+ widgets << new QLabel("<b>TESTING TESTING</b>");
foreach (QWidget *widget, widgets) {
//without Qt::X11BypassWindowManagerHint the window manager may move the window after we moved the cursor