From f94f1653368bf8c499fa9a6eeba81736bb2a7710 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 27 Jul 2022 19:02:59 +0200 Subject: Document shell-friendly data tags as best practice Also follow this best practice in testlib's own documentation and examples. Pick-to: 6.4 Change-Id: I8b57dfa8f88835adae8fceeb122a16635708e338 Reviewed-by: Paul Wicking --- examples/qtestlib/tutorial2/testqstring.cpp | 4 ++-- examples/qtestlib/tutorial4/testgui.cpp | 2 +- examples/qtestlib/tutorial5/benchmarking.cpp | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/qtestlib/tutorial2/testqstring.cpp b/examples/qtestlib/tutorial2/testqstring.cpp index 2e87292daa..fa6779a16f 100644 --- a/examples/qtestlib/tutorial2/testqstring.cpp +++ b/examples/qtestlib/tutorial2/testqstring.cpp @@ -20,9 +20,9 @@ void TestQString::toUpper_data() QTest::addColumn("string"); QTest::addColumn("result"); - QTest::newRow("all lower") << "hello" << "HELLO"; + QTest::newRow("all-lower") << "hello" << "HELLO"; QTest::newRow("mixed") << "Hello" << "HELLO"; - QTest::newRow("all upper") << "HELLO" << "HELLO"; + QTest::newRow("all-upper") << "HELLO" << "HELLO"; } //! [1] diff --git a/examples/qtestlib/tutorial4/testgui.cpp b/examples/qtestlib/tutorial4/testgui.cpp index 58f895cef5..527532edee 100644 --- a/examples/qtestlib/tutorial4/testgui.cpp +++ b/examples/qtestlib/tutorial4/testgui.cpp @@ -28,7 +28,7 @@ void TestGui::testGui_data() QTestEventList list2; list2.addKeyClick('a'); list2.addKeyClick(Qt::Key_Backspace); - QTest::newRow("there and back again") << list2 << ""; + QTest::newRow("there+back-again") << list2 << ""; } //! [1] 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("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("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] -- cgit v1.2.3