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/concurrent/qtconcurrentiteratekernel | |
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/concurrent/qtconcurrentiteratekernel')
-rw-r--r-- | tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp index 521c517d90..2cf6fe9a2d 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp +++ b/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp @@ -100,8 +100,10 @@ private slots: void stresstest(); void noIterations(); void throttling(); +#ifndef QT_NO_STL void blockSize(); void multipleResults(); +#endif #if 0 //"while" iterations tests: void instantiateWhile(); @@ -274,17 +276,17 @@ public: } }; +// Missing stl iterators prevent correct block size calculation. +#ifndef QT_NO_STL void tst_QtConcurrentIterateKernel::blockSize() { -#ifdef QT_NO_STL - QSKIP("Missing stl iterators prevent correct block size calculation", SkipAll); -#endif const int expectedMinimumBlockSize = 1024 / QThread::idealThreadCount(); BlockSizeRecorder(0, 10000).startBlocking(); if (peakBlockSize < expectedMinimumBlockSize) qDebug() << "block size" << peakBlockSize; QVERIFY(peakBlockSize >= expectedMinimumBlockSize); } +#endif class MultipleResultsFor : public IterateKernel<TestIterator, int> { @@ -298,12 +300,10 @@ public: } }; - +// Missing stl iterators prevent correct summation. +#ifndef QT_NO_STL void tst_QtConcurrentIterateKernel::multipleResults() { -#ifdef QT_NO_STL - QSKIP("Missing stl iterators prevent correct summation", SkipAll); -#endif QFuture<int> f = startThreadEngine(new MultipleResultsFor(0, 10)).startAsynchronously(); QCOMPARE(f.results().count() , 10); QCOMPARE(f.resultAt(0), 0); @@ -311,6 +311,7 @@ void tst_QtConcurrentIterateKernel::multipleResults() QCOMPARE(f.resultAt(9), 9); f.waitForFinished(); } +#endif #if 0 class PrintWhile : public IterateKernel<TestIterator, void> |