diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2022-07-27 19:02:59 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-09-07 15:53:25 +0000 |
commit | ddeb1c9a7f91b2011add97684f36cee513cf7872 (patch) | |
tree | 709e5442584dad0cf466ae02f85d3f02aa6f5f0d /examples/qtestlib/tutorial5/benchmarking.cpp | |
parent | 63788de25bb36ec1de0e7d550e6b2d02c8080995 (diff) |
Document shell-friendly data tags as best practice
Also follow this best practice in testlib's own documentation and
examples.
Change-Id: I8b57dfa8f88835adae8fceeb122a16635708e338
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit f94f1653368bf8c499fa9a6eeba81736bb2a7710)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/qtestlib/tutorial5/benchmarking.cpp')
-rw-r--r-- | examples/qtestlib/tutorial5/benchmarking.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/qtestlib/tutorial5/benchmarking.cpp b/examples/qtestlib/tutorial5/benchmarking.cpp index d22baa3cff..d88780757a 100644 --- a/examples/qtestlib/tutorial5/benchmarking.cpp +++ b/examples/qtestlib/tutorial5/benchmarking.cpp @@ -33,8 +33,8 @@ void TestBenchmark::simple() void TestBenchmark::multiple_data() { QTest::addColumn<bool>("useLocaleCompare"); - QTest::newRow("locale aware compare") << true; - QTest::newRow("standard compare") << false; + QTest::newRow("locale-aware-compare") << true; + QTest::newRow("standard-compare") << false; } //! [1] @@ -66,9 +66,8 @@ void TestBenchmark::series_data() QTest::addColumn<int>("stringSize"); for (int i = 1; i < 10000; i += 2000) { - QByteArray size = QByteArray::number(i); - QTest::newRow(("locale aware compare--" + size).constData()) << true << i; - QTest::newRow(("standard compare--" + size).constData()) << false << i; + QTest::addRow("locale-aware-compare:%d", i) << true << i; + QTest::addRow("standard-compare:%d", i) << false << i; } } //! [4] |