diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp index a5748ae..3b1e18f 100644 --- a/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp +++ b/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp @@ -66,6 +66,7 @@ struct TestIterator }; #include <qiterator.h> +#ifndef QT_NO_STL namespace std { template <> struct iterator_traits<TestIterator> @@ -79,6 +80,7 @@ int distance(TestIterator &a, TestIterator &b) } } +#endif #include <qtconcurrentiteratekernel.h> @@ -112,7 +114,7 @@ class PrintFor : public IterateKernel<TestIterator, void> { public: PrintFor(TestIterator begin, TestIterator end) : IterateKernel<TestIterator, void>(begin, end) {iterations = 0; } - inline bool runIterations(TestIterator/*beginIterator*/, int begin, int end, void *) + bool runIterations(TestIterator/*beginIterator*/, int begin, int end, void *) { iterations.fetchAndAddRelaxed(end - begin); #ifdef PRINT @@ -120,6 +122,11 @@ public: #endif return false; } + bool runIteration(TestIterator it, int index , void *result) + { + return runIterations(it, index, index + 1, result); + } + }; class SleepPrintFor : public IterateKernel<TestIterator, void> @@ -135,6 +142,10 @@ public: #endif return false; } + bool runIteration(TestIterator it, int index , void *result) + { + return runIterations(it, index, index + 1, result); + } }; @@ -165,6 +176,10 @@ public: counter.fetchAndAddRelaxed(end - begin); return false; } + bool runIteration(TestIterator it, int index , void *result) + { + return runIterations(it, index, index + 1, result); + } }; void tst_iteratekernel::stresstest() @@ -215,6 +230,10 @@ public: return false; } + bool runIteration(TestIterator it, int index , void *result) + { + return runIterations(it, index, index + 1, result); + } bool shouldThrottleThread() { @@ -254,6 +273,9 @@ public: void tst_iteratekernel::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) @@ -276,6 +298,9 @@ public: void tst_iteratekernel::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); |