diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2012-02-21 14:58:57 +0100 |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2012-02-21 14:58:57 +0100 |
commit | 31a0358afb4fde998d1eeeaa80fc32e4420266c7 (patch) | |
tree | 938455353474196c1f49b0529b5b644e19c21f3e /tests/benchmarks/corelib/tools | |
parent | 4c8a4058c359c8d163c643120426079fc80c8214 (diff) | |
parent | 69da8588d41bbf5ab785f5ad7c1fce76deefc7d0 (diff) |
Merge remote-tracking branch 'gerrit/master' into containers
Conflicts:
src/corelib/tools/qbytearray.h
Change-Id: I03b1f3e05c9b7a45130887c522fcd9b7aa387129
Diffstat (limited to 'tests/benchmarks/corelib/tools')
-rw-r--r-- | tests/benchmarks/corelib/tools/containers-sequential/main.cpp | 2 | ||||
-rw-r--r-- | tests/benchmarks/corelib/tools/qhash/main.cpp | 36 |
2 files changed, 31 insertions, 7 deletions
diff --git a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp b/tests/benchmarks/corelib/tools/containers-sequential/main.cpp index ee13a63a57..e42a40b110 100644 --- a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp +++ b/tests/benchmarks/corelib/tools/containers-sequential/main.cpp @@ -133,7 +133,7 @@ struct Large { // A "large" item type }; // Embedded devices typically have limited memory -#if defined(Q_WS_WINCE) +#if defined(Q_OS_WINCE) # define LARGE_MAX_SIZE 2000 #else # define LARGE_MAX_SIZE 20000 diff --git a/tests/benchmarks/corelib/tools/qhash/main.cpp b/tests/benchmarks/corelib/tools/qhash/main.cpp index 6f3228d0eb..18138cbd47 100644 --- a/tests/benchmarks/corelib/tools/qhash/main.cpp +++ b/tests/benchmarks/corelib/tools/qhash/main.cpp @@ -45,7 +45,7 @@ #include <QHash> #include <QString> #include <QStringList> - +#include <QUuid> #include <QTest> @@ -69,12 +69,36 @@ private: void tst_QHash::data() { - QFile smallPathsData("paths_small_data.txt"); - smallPathsData.open(QIODevice::ReadOnly); - QTest::addColumn<QStringList>("items"); - QTest::newRow("paths-small") - << QString::fromLatin1(smallPathsData.readAll()).split(QLatin1Char('\n')); + static QStringList smallFilePaths; + + { + // small list of file paths + if (smallFilePaths.isEmpty()) { + QFile smallPathsData("paths_small_data.txt"); + QVERIFY(smallPathsData.open(QIODevice::ReadOnly)); + smallFilePaths = QString::fromLatin1(smallPathsData.readAll()).split(QLatin1Char('\n')); + Q_ASSERT(!smallFilePaths.isEmpty()); + } + + QTest::newRow("paths-small") << smallFilePaths; + } + + { + // list of UUIDs + static QStringList uuids; + if (uuids.isEmpty()) { + // guaranteed to be completely random, generated by http://xkcd.com/221/ + QUuid ns = QUuid("{f43d2ef3-2fe9-4563-a6f5-5a0100c2d699}"); + uuids.reserve(smallFilePaths.size()); + + foreach (const QString &path, smallFilePaths) + uuids.append(QUuid::createUuidV5(ns, path).toString()); + } + + QTest::newRow("uuids-list") << uuids; + } + } void tst_QHash::qhash_qt4() |