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 + void tst_QHash::data() { QTest::addColumn("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()