From 40bfc2d8a078ce1cadfe0491e2843d028eca9f32 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 10 Aug 2021 12:19:37 +0200 Subject: [PATCH] Clean up some notes in QtTestLib documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use \note instead of \b{Note:}, don't refer to functions as macros, and don't lie. The data-table set-up functions can delegate their calls to addColumn(), addRow() and newRow() to functions not called directly by the test framework. Change-Id: I3bef22cf1a45df91dc822ac04f07e7d15053825f Reviewed-by: Paul Wicking Reviewed-by: Tor Arne Vestbø --- src/testlib/qtestcase.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 538ee55177a..622677b5864 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1856,7 +1856,7 @@ static void initEnvironment() than once, as command-line options for logging test output to files and executing individual test functions will not behave correctly. - Note: This function is not reentrant, only one test can run at a time. A + \note This function is not reentrant, only one test can run at a time. A test that was executed with qExec() can't run another test via qExec() and threads are not allowed to call qExec() simultaneously. @@ -2078,9 +2078,9 @@ void QTest::qWarn(const char *message, const char *file, int line) test log. If the test finished and the \a message was not outputted, a test failure is appended to the test log. - \b {Note:} Invoking this function will only ignore one message. - If the message you want to ignore is outputted twice, you have to - call ignoreMessage() twice, too. + \note Invoking this function will only ignore one message. If the message + you want to ignore is output twice, you have to call ignoreMessage() twice, + too. Example: \snippet code/src_qtestlib_qtestcase.cpp 19 @@ -2103,9 +2103,9 @@ void QTest::ignoreMessage(QtMsgType type, const char *message) test log. If the test finished and the message was not outputted, a test failure is appended to the test log. - \b {Note:} Invoking this function will only ignore one message. - If the message you want to ignore is outputted twice, you have to - call ignoreMessage() twice, too. + \note Invoking this function will only ignore one message. If the message + you want to ignore is output twice, you have to call ignoreMessage() twice, + too. \since 5.3 */ @@ -2384,7 +2384,7 @@ void QTest::addColumnInternal(int id, const char *name) Example: \snippet code/src_qtestlib_qtestcase.cpp 20 - \b {Note:} This macro can only be used in a test's data function + \note This function can only be called as part of a test's data function that is invoked by the test framework. See \l {Chapter 2: Data Driven Testing}{Data Driven Testing} for @@ -2416,7 +2416,7 @@ QTestData &QTest::newRow(const char *dataTag) Example: \snippet code/src_qtestlib_qtestcase.cpp addRow - \b {Note:} This function can only be used in a test's data function + \note This function can only be called as part of a test's data function that is invoked by the test framework. See \l {Chapter 2: Data Driven Testing}{Data Driven Testing} for @@ -2459,8 +2459,8 @@ QTestData &QTest::addRow(const char *format, ...) To add custom types to the testdata, the type must be registered with QMetaType via \l Q_DECLARE_METATYPE(). - \b {Note:} This macro can only be used in a test's data function - that is invoked by the test framework. + \note This function can only be used called as part of a test's data + function that is invoked by the test framework. See \l {Chapter 2: Data Driven Testing}{Data Driven Testing} for a more extensive example.