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/qmessagebox | |
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/qmessagebox')
-rw-r--r-- | tests/auto/qmessagebox/tst_qmessagebox.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp index 12b6029a8f..463d4c4f82 100644 --- a/tests/auto/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp @@ -124,7 +124,9 @@ private slots: void detailsText(); void detailsButtonText(); +#ifndef Q_WS_MAC void shortcut(); +#endif void staticSourceCompat(); void instanceSourceCompat(); @@ -366,17 +368,17 @@ void tst_QMessageBox::statics() } } +// Shortcuts are not used on Mac OS X. +#ifndef Q_WS_MAC void tst_QMessageBox::shortcut() { -#ifdef Q_WS_MAC - QSKIP("shortcuts are not used on MAC OS X", SkipAll); -#endif QMessageBox msgBox; msgBox.addButton("O&k", QMessageBox::YesRole); msgBox.addButton("&No", QMessageBox::YesRole); msgBox.addButton("&Maybe", QMessageBox::YesRole); QCOMPARE(exec(&msgBox, Qt::Key_M), 2); } +#endif void tst_QMessageBox::about() { @@ -486,11 +488,11 @@ void tst_QMessageBox::instanceSourceCompat() QCOMPARE(exec(&mb, Qt::Key_Enter), int(QMessageBox::Yes)); QCOMPARE(exec(&mb, Qt::Key_Escape), int(QMessageBox::Cancel)); -#ifdef Q_WS_MAC - QSKIP("mnemonics are not used on the MAC OS X", SkipAll); -#endif +#ifndef Q_WS_MAC + // mnemonics are not used on Mac OS X QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_R), 0); QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_Z), 1); +#endif } void tst_QMessageBox::testSymbols() |