summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/qstringlist
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2009-08-24 13:45:29 (GMT)
committerhjk <qtc-committer@nokia.com>2009-08-24 14:58:04 (GMT)
commit4a64bbc856e8bed831d1e0accff0aa722f5c64c8 (patch)
tree9c9e80eeea043d70c269616ff2d2ab5d26ffa611 /tests/benchmarks/qstringlist
parent1a71668483380f45cacda30cc55424d09def0636 (diff)
downloadQt-4a64bbc856e8bed831d1e0accff0aa722f5c64c8.zip
Qt-4a64bbc856e8bed831d1e0accff0aa722f5c64c8.tar.gz
Qt-4a64bbc856e8bed831d1e0accff0aa722f5c64c8.tar.bz2
add a QByteArray based example to the QString::split() benchmark
Diffstat (limited to 'tests/benchmarks/qstringlist')
-rw-r--r--tests/benchmarks/qstringlist/main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/benchmarks/qstringlist/main.cpp b/tests/benchmarks/qstringlist/main.cpp
index 645b4f0..6af41c0 100644
--- a/tests/benchmarks/qstringlist/main.cpp
+++ b/tests/benchmarks/qstringlist/main.cpp
@@ -63,6 +63,9 @@ private slots:
void split_stdw() const;
void split_stdw_data() const { return split_data(); }
+ void split_ba() const;
+ void split_ba_data() const { return split_data(); }
+
private:
static QStringList populateList(const int count, const QString &unit);
static QString populateString(const int count, const QString &unit);
@@ -174,6 +177,17 @@ void tst_QStringList::split_stdw() const
}
}
+void tst_QStringList::split_ba() const
+{
+ QFETCH(QString, input);
+ const char splitChar = ':';
+ QByteArray ba = input.toLatin1();
+
+ QBENCHMARK {
+ ba.split(splitChar);
+ }
+}
+
QTEST_MAIN(tst_QStringList)
#include "main.moc"