diff options
| author | Emmanuel Pescosta <[email protected]> | 2014-12-18 14:56:46 +0100 |
|---|---|---|
| committer | Emmanuel Pescosta <[email protected]> | 2014-12-18 14:56:46 +0100 |
| commit | d19d94e60a778d4c19f646224e3b269da515c8fb (patch) | |
| tree | c634267e074b59bfce8e9f4c9ea90bb85c56089b /src/tests/kfileitemmodelbenchmark.cpp | |
| parent | 95220eebae1be024b84b069ce9ae4be35c9e6a5f (diff) | |
Ported tests away from KRandomSequence, QTest::kWaitForSignal and KTempDir.
All tests passed!
Diffstat (limited to 'src/tests/kfileitemmodelbenchmark.cpp')
| -rw-r--r-- | src/tests/kfileitemmodelbenchmark.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/tests/kfileitemmodelbenchmark.cpp b/src/tests/kfileitemmodelbenchmark.cpp index 43d7173de..c970a7198 100644 --- a/src/tests/kfileitemmodelbenchmark.cpp +++ b/src/tests/kfileitemmodelbenchmark.cpp @@ -18,15 +18,17 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ -#include <qtest.h> +#include <QTest> #include <QSignalSpy> + +#include <algorithm> +#include <random> + #include "kitemviews/kfileitemmodel.h" #include "kitemviews/private/kfileitemmodelsortalgorithm.h" #include "testdir.h" -#include <KRandomSequence> - void myMessageOutput(QtMsgType type, const char* msg) { switch (type) { @@ -45,10 +47,6 @@ void myMessageOutput(QtMsgType type, const char* msg) } } -namespace { - const int DefaultTimeout = 5000; -}; - Q_DECLARE_METATYPE(KFileItemList) Q_DECLARE_METATYPE(KItemRangeList) @@ -294,8 +292,9 @@ void KFileItemModelBenchmark::insertManyChildItems() } // Bring the items into random order. - KRandomSequence randomSequence(0); - randomSequence.randomize(newItems); + std::random_device rd; + std::mt19937 g(rd()); + std::shuffle(newItems.begin(), newItems.end(), g); // Measure how long it takes to insert and then remove all files. QBENCHMARK { |
