summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/benchmarks/corelib/tools/qhash/main.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/benchmarks/corelib/tools/qhash/main.cpp b/tests/benchmarks/corelib/tools/qhash/main.cpp
index 18138cbd47..db33200d43 100644
--- a/tests/benchmarks/corelib/tools/qhash/main.cpp
+++ b/tests/benchmarks/corelib/tools/qhash/main.cpp
@@ -67,6 +67,8 @@ private:
///////////////////// QHash /////////////////////
+#include <QDebug>
+
void tst_QHash::data()
{
QTest::addColumn<QStringList>("items");
@@ -99,6 +101,40 @@ void tst_QHash::data()
QTest::newRow("uuids-list") << uuids;
}
+ {
+ // lots of strings with alphabetical characters, vaguely reminiscent of
+ // a dictionary.
+ //
+ // this programatically generates a series like:
+ // AAAAAA
+ // AAAAAB
+ // AAAAAC
+ // ...
+ // AAAAAZ
+ // AAAABZ
+ // ...
+ // AAAAZZ
+ // AAABZZ
+ QByteArray id("AAAAAAA");
+ static QStringList dict;
+
+ if (dict.isEmpty()) {
+ for (int i = id.length() - 1; i > 0;) {
+ dict.append(id);
+ char c = id.at(i);
+ id[i] = ++c;
+
+ if (c == 'Z') {
+ // wrap to next digit
+ i--;
+ id[i] = 'A';
+ }
+ }
+ }
+
+ QTest::newRow("dictionary") << dict;
+ }
+
}
void tst_QHash::qhash_qt4()