diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-10-04 11:51:31 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-05 03:04:31 +0200 |
commit | 7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6 (patch) | |
tree | 5df8fca668dace17eea7b6c5ed82db8e87180105 /tests/auto/corelib/io/qdiriterator | |
parent | c46f59fadf63b661d8611e5896f09fb85c17a00c (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: Ib2025339422749cf216e87ac414a3056250bf8f9
Reviewed-on: http://codereview.qt-project.org/5942
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/io/qdiriterator')
-rw-r--r-- | tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp index db8a0223e5..47e432d432 100644 --- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp @@ -121,7 +121,9 @@ private slots: void uncPaths_data(); void uncPaths(); #endif +#if !defined(Q_OS_WIN) && !defined(Q_OS_WINCE) void qtbug15421_hiddenDirs_hiddenFiles(); +#endif }; tst_QDirIterator::tst_QDirIterator() @@ -170,6 +172,7 @@ tst_QDirIterator::tst_QDirIterator() # endif #endif +#if !defined(Q_OS_WIN) && !defined(Q_OS_WINCE) createDirectory("qtbug15421_hiddenDirs_hiddenFiles"); createFile("qtbug15421_hiddenDirs_hiddenFiles/normalFile"); createFile("qtbug15421_hiddenDirs_hiddenFiles/.hiddenFile"); @@ -183,6 +186,7 @@ tst_QDirIterator::tst_QDirIterator() createDirectory("qtbug15421_hiddenDirs_hiddenFiles/normalDirectory/.hiddenDirectory"); createDirectory("qtbug15421_hiddenDirs_hiddenFiles/.hiddenDirectory/normalDirectory"); createDirectory("qtbug15421_hiddenDirs_hiddenFiles/.hiddenDirectory/.hiddenDirectory"); +#endif } tst_QDirIterator::~tst_QDirIterator() @@ -588,15 +592,13 @@ void tst_QDirIterator::uncPaths() } #endif +// In Unix it is easy to create hidden files, but in Windows it requires +// a special call since hidden files need to be "marked" while in Unix +// anything starting by a '.' is a hidden file. +// For that reason this test is not run in Windows. +#if !defined(Q_OS_WIN) && !defined(Q_OS_WINCE) void tst_QDirIterator::qtbug15421_hiddenDirs_hiddenFiles() { - // In Unix it is easy to create hidden files, but in Windows it requires - // a special call since hidden files need to be "marked" while in Unix - // anything starting by a '.' is a hidden file. - // For that reason this test is not run in Windows. -#if defined Q_OS_WIN || Q_OS_WINCE - QSKIP("To create hidden files a special call is required in Windows.", SkipAll); -#else // Only files { int matches = 0; @@ -625,8 +627,8 @@ void tst_QDirIterator::qtbug15421_hiddenDirs_hiddenFiles() QCOMPARE(matches, 6); QCOMPARE(failures, 0); } -#endif // Q_OS_WIN || Q_OS_WINCE } +#endif QTEST_MAIN(tst_QDirIterator) |