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/qlineedit | |
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/qlineedit')
-rw-r--r-- | tests/auto/qlineedit/tst_qlineedit.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index 891a6071fc..5cae5b8aee 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -256,7 +256,9 @@ private slots: void noTextEditedOnClear(); +#ifndef QT_NO_CURSOR void cursor(); +#endif void textMargin_data(); void textMargin(); @@ -280,7 +282,9 @@ private slots: void taskQTBUG_7902_contextMenuCrash(); #endif void taskQTBUG_7395_readOnlyShortcut(); +#ifdef Q_WS_X11 void QTBUG697_paletteCurrentColorGroup(); +#endif void QTBUG13520_textNotVisible(); void bidiVisualMovement_data(); @@ -3331,19 +3335,17 @@ void tst_QLineEdit::textMargin() QTRY_COMPARE(testWidget.cursorPosition(), cursorPosition); } +#ifndef QT_NO_CURSOR void tst_QLineEdit::cursor() { -#ifdef QT_NO_CURSOR - QSKIP("Qt compiled without cursor support", SkipAll); -#else testWidget->setReadOnly(false); QCOMPARE(testWidget->cursor().shape(), Qt::IBeamCursor); testWidget->setReadOnly(true); QCOMPARE(testWidget->cursor().shape(), Qt::ArrowCursor); testWidget->setReadOnly(false); QCOMPARE(testWidget->cursor().shape(), Qt::IBeamCursor); -#endif } +#endif class task180999_Widget : public QWidget { @@ -3708,11 +3710,9 @@ void tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut() QCOMPARE(spy.count(), 1); } +#ifdef Q_WS_X11 void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup() { -#ifndef Q_WS_X11 - QSKIP("Only tested on X11", SkipAll); -#endif QLineEdit le; le.setText(" "); QPalette p = le.palette(); @@ -3734,6 +3734,7 @@ void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup() le.render(&img); QCOMPARE(img.pixel(10, le.height()/2), QColor(Qt::red).rgb()); } +#endif void tst_QLineEdit::QTBUG13520_textNotVisible() { |