diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-10-04 13:23:23 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-05 06:15:00 +0200 |
commit | 253497b7446c7d723aa3bdd7152e25d6852f2604 (patch) | |
tree | e91eb9fdb94aae121fa587ab5f54f3917a6c1d55 /tests/auto/qstyle | |
parent | 3f88da82b1bdf79fe4c89640838b0b69c8a89d8b (diff) |
Avoid using QSKIP in lieu of compile-time checks
QSKIP is intended to be used to skip test functions that are found at
run-time to be inapplicable or unsafe. If a test function can be
determined to be inapplicable at compile-time, the entire test function
should be omitted instead of replacing the body of the test function
with a QSKIP, which only serves to slow down test runs and to inflate
test run-rates with empty, inapplicable tests.
Task-number: QTQAINFRA-278
Change-Id: I582732e3dd657df834f9a98fd52d7ee368f2f29b
Reviewed-on: http://codereview.qt-project.org/5946
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/qstyle')
-rw-r--r-- | tests/auto/qstyle/tst_qstyle.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/auto/qstyle/tst_qstyle.cpp b/tests/auto/qstyle/tst_qstyle.cpp index ae94badbe3..0f04b734dc 100644 --- a/tests/auto/qstyle/tst_qstyle.cpp +++ b/tests/auto/qstyle/tst_qstyle.cpp @@ -127,13 +127,23 @@ private slots: void cleanupTestCase(); void init(); void cleanup(); +#ifndef QT_NO_STYLE_MOTIF void testMotifStyle(); +#endif +#ifndef QT_NO_STYLE_PLASTIQUE void testPlastiqueStyle(); +#endif void testWindowsStyle(); +#ifndef QT_NO_STYLE_CDE void testCDEStyle(); +#endif +#if defined(Q_WS_WIN) && !defined(QT_NO_STYLE_WINDOWSXP) void testWindowsXPStyle(); +#endif void testWindowsVistaStyle(); +#ifndef QT_NO_STYLE_CLEANLOOKS void testCleanlooksStyle(); +#endif void testMacStyle(); void testWindowsCEStyle(); void testWindowsMobileStyle(); @@ -378,27 +388,23 @@ void tst_QStyle::testScrollBarSubControls(QStyle* style) } } +#ifndef QT_NO_STYLE_PLASTIQUE void tst_QStyle::testPlastiqueStyle() { -#if !defined(QT_NO_STYLE_PLASTIQUE) QPlastiqueStyle pstyle; testAllFunctions(&pstyle); lineUpLayoutTest(&pstyle); -#else - QSKIP("No Plastique style", SkipAll); -#endif } +#endif +#ifndef QT_NO_STYLE_CLEANLOOKS void tst_QStyle::testCleanlooksStyle() { -#if !defined(QT_NO_STYLE_CLEANLOOKS) QCleanlooksStyle cstyle; testAllFunctions(&cstyle); lineUpLayoutTest(&cstyle); -#else - QSKIP("No Cleanlooks style", SkipAll); -#endif } +#endif void tst_QStyle::testWindowsStyle() { @@ -414,16 +420,14 @@ void tst_QStyle::testWindowsStyle() wstyle.drawControl(QStyle::CE_ProgressBar, &pb, &painter, 0); } +#if defined(Q_WS_WIN) && !defined(QT_NO_STYLE_WINDOWSXP) void tst_QStyle::testWindowsXPStyle() { -#if defined(Q_WS_WIN) && !defined(QT_NO_STYLE_WINDOWSXP) QWindowsXPStyle xpstyle; testAllFunctions(&xpstyle); lineUpLayoutTest(&xpstyle); -#else - QSKIP("No WindowsXP style", SkipAll); -#endif } +#endif void writeImage(const QString &fileName, QImage image) { @@ -566,25 +570,21 @@ void tst_QStyle::testMacStyle() #endif } +#ifndef QT_NO_STYLE_MOTIF void tst_QStyle::testMotifStyle() { -#if !defined(QT_NO_STYLE_MOTIF) QMotifStyle mstyle; testAllFunctions(&mstyle); -#else - QSKIP("No Motif style", SkipAll); -#endif } +#endif +#ifndef QT_NO_STYLE_CDE void tst_QStyle::testCDEStyle() { -#if !defined(QT_NO_STYLE_CDE) QCDEStyle cstyle; testAllFunctions(&cstyle); -#else - QSKIP("No CDE style", SkipAll); -#endif } +#endif void tst_QStyle::testWindowsCEStyle() { |