summaryrefslogtreecommitdiffstats
path: root/src/testlib/doc/snippets/code
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@digia.com>2012-11-29 14:07:19 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-30 00:50:12 +0100
commit1970552e727855fd45b7b2fe3b56c14cdbf6eb58 (patch)
treef30406612692ae3febe362b4b9730c877b1bba7c /src/testlib/doc/snippets/code
parentd835ebf39cb7fbd303f818b12ea0cd8fa93be3b1 (diff)
Fix missing code snippet in QTest doc.
Change-Id: I6fb1167634b0acddfa61b92d104d98ba8a1a15cb Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/testlib/doc/snippets/code')
-rw-r--r--src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp b/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
index 5c22b7c235..b2816d6576 100644
--- a/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
+++ b/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
@@ -246,5 +246,19 @@ void tst_MyXmlParser::parse()
}
//! [26]
+//! [27]
+void TestBenchmark::simple()
+{
+ QString str1 = QLatin1String("This is a test string");
+ QString str2 = QLatin1String("This is a test string");
+
+ QCOMPARE(str1.localeAwareCompare(str2), 0);
+
+ QBENCHMARK {
+ str1.localeAwareCompare(str2);
+ }
+}
+//! [27]
+
}