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/qdirmodel/tst_qdirmodel.cpp | |
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/qdirmodel/tst_qdirmodel.cpp')
-rw-r--r-- | tests/auto/qdirmodel/tst_qdirmodel.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/auto/qdirmodel/tst_qdirmodel.cpp b/tests/auto/qdirmodel/tst_qdirmodel.cpp index 2e7b012ce6..70eb17b5e6 100644 --- a/tests/auto/qdirmodel/tst_qdirmodel.cpp +++ b/tests/auto/qdirmodel/tst_qdirmodel.cpp @@ -92,7 +92,9 @@ private slots: void filePath(); +#ifdef Q_OS_UNIX void hidden(); +#endif void fileName(); void fileName_data(); @@ -511,9 +513,9 @@ void tst_QDirModel::rowsAboutToBeRemoved() QVERIFY(rowsAboutToBeRemoved_cleanup(test_path)); } +#ifdef Q_OS_UNIX void tst_QDirModel::hidden() { -#ifdef Q_OS_UNIX QDir current; current.mkdir(".qtest_hidden"); @@ -529,10 +531,8 @@ void tst_QDirModel::hidden() model2.setFilter(model2.filter() | QDir::Hidden); index = model2.index(QDir::currentPath() + "/.qtest_hidden"); QVERIFY(index.isValid()); -#else - QSKIP("Test not implemented on non-Unixes", SkipAll); -#endif } +#endif void tst_QDirModel::fileName_data() { @@ -555,9 +555,9 @@ void tst_QDirModel::fileName() } #if 0 +#ifdef Q_OS_UNIX void tst_QDirModel::unreadable() { -#ifdef Q_OS_UNIX //QFile current("qtest_unreadable"); //QVERIFY(current.setPermissions(QFile::WriteOwner)); @@ -569,11 +569,9 @@ void tst_QDirModel::unreadable() model2.setFilter(model2.filter() | QDir::Hidden); index = model2.index(QDir::currentPath() + "/qtest_unreadable"); QVERIFY(index.isValid()); -#else - QSKIP("Test not implemented on non-Unixes", SkipAll); -#endif } #endif +#endif void tst_QDirModel::filePath() { |