diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-10-26 15:37:01 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-27 11:14:21 +0200 |
commit | 1bc8f124b8c45daa391205eef12746a64473c8f9 (patch) | |
tree | 7063a63a6a72e09fa5fdab7b3c2b2aee85bbb0ad | |
parent | c9bc2a6fda97ef883981d0bd2bef09b9c54d728f (diff) |
Prefer compile-time checks to QSKIP.
Qt has compile-time defines for determining the presence of each style
in the build. Use these to exclude inapplicable test data instead of
including all test data and then being unable to distinguish the absence
of a style from regressions in QStyleFactory.
Change-Id: Iab1756aec80892a8b587bb635779537c64b1d4dd
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
-rw-r--r-- | tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp index c79d157880..ed33881d6d 100644 --- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp +++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp @@ -563,15 +563,39 @@ void tst_QPushButton::defaultAndAutoDefault() void tst_QPushButton::sizeHint_data() { QTest::addColumn<QString>("stylename"); +#if !defined(QT_NO_STYLE_MOTIF) QTest::newRow("motif") << QString::fromAscii("motif"); +#endif +#if !defined(QT_NO_STYLE_CDE) QTest::newRow("cde") << QString::fromAscii("cde"); +#endif +#if !defined(QT_NO_STYLE_WINDOWS) QTest::newRow("windows") << QString::fromAscii("windows"); +#endif +#if !defined(QT_NO_STYLE_CLEANLOOKS) QTest::newRow("cleanlooks") << QString::fromAscii("cleanlooks"); +#endif +#if !defined(QT_NO_STYLE_GTK) QTest::newRow("gtk") << QString::fromAscii("gtk"); +#endif +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) QTest::newRow("mac") << QString::fromAscii("mac"); +#endif +#if !defined(QT_NO_STYLE_PLASTIQUE) QTest::newRow("plastique") << QString::fromAscii("plastique"); +#endif +#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSXP) QTest::newRow("windowsxp") << QString::fromAscii("windowsxp"); +#endif +#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA) QTest::newRow("windowsvista") << QString::fromAscii("windowsvista"); +#endif +#if defined(Q_OS_WINCE) && !defined(QT_NO_STYLE_WINDOWSCE) + QTest::newRow("windowsce") << QString::fromAscii("windowsce"); +#endif +#if defined(Q_OS_WINCE_WM) && !defined(QT_NO_STYLE_WINDOWSCE) + QTest::newRow("windowsmobile") << QString::fromAscii("windowsmobile"); +#endif } void tst_QPushButton::sizeHint() @@ -580,7 +604,7 @@ void tst_QPushButton::sizeHint() QStyle *style = QStyleFactory::create(stylename); if (!style) - QSKIP(qPrintable(QString::fromLatin1("Qt has been compiled without style: %1").arg(stylename))); + QFAIL(qPrintable(QString::fromLatin1("Cannot create style: %1").arg(stylename))); QApplication::setStyle(style); // Test 1 |