Fix missing code snippet in QTest doc.
authorChristian Strømme <christian.stromme@digia.com>
Thu, 29 Nov 2012 13:07:19 +0000 (14:07 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 29 Nov 2012 23:50:12 +0000 (00:50 +0100)
Change-Id: I6fb1167634b0acddfa61b92d104d98ba8a1a15cb
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
src/testlib/qtestcase.cpp

index 5c22b7c..b2816d6 100644 (file)
@@ -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]
+
 }
 
index 6f8b12b..d4266c0 100644 (file)
@@ -483,7 +483,7 @@ QT_BEGIN_NAMESPACE
 
     For example:
 
-    \snippet qtestlib/tutorial5/benchmarking.cpp 0
+    \snippet code/src_qtestlib_qtestcase.cpp 27
 
     \sa {Qt Test Overview#Creating a Benchmark}{Creating a Benchmark},
         {Chapter 5: Writing a Benchmark}{Writing a Benchmark}