summaryrefslogtreecommitdiffstats
path: root/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp')
-rw-r--r--src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp b/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
index 63d0b992fc..4716d06e55 100644
--- a/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
+++ b/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
@@ -56,8 +56,8 @@ void TestQString::toInt_data()
QTest::addColumn<QString>("aString");
QTest::addColumn<int>("expected");
- QTest::newRow("positive value") << "42" << 42;
- QTest::newRow("negative value") << "-42" << -42;
+ QTest::newRow("positive+value") << "42" << 42;
+ QTest::newRow("negative-value") << "-42" << -42;
QTest::newRow("zero") << "0" << 0;
}
//! [3]
@@ -135,8 +135,8 @@ dir.mkdir("");
void MyTestClass::addSingleStringRows()
{
QTest::addColumn<QString>("aString");
- QTest::newRow("just hello") << QString("hello");
- QTest::newRow("a null string") << QString();
+ QTest::newRow("just.hello") << QString("hello");
+ QTest::newRow("a.null.string") << QString();
}
//! [20]
@@ -170,10 +170,11 @@ void MyTestClass::cleanup()
}
//! [22]
-void mySleep()
+void quarterSecondSleep()
{
//! [23]
-QTest::qSleep(250);
+using namespace std::chrono_literals;
+QTest::qSleep(250ms);
//! [23]
}