summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-01-10 10:13:55 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-10 19:54:03 +0100
commitdc5ea809634560e836d2847f42f66beb43db7924 (patch)
tree5a80b2e483451e19da23af36f706c95bc102416c /src/testlib/qtestcase.cpp
parent00d4b151123b5df415db9cd49d4683ac485cf1e7 (diff)
Tests: Remove duplicate QTRY_VERIFY/QTRY_COMPARE macros in bearer.
Introduce QTRY_VERIFY_WITH_TIMEOUT and QTRY_COMPARE_WITH_TIMEOUT to be able to specify a timeout value. Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Change-Id: Iaeaa4938eb14f2c431537055f626510cba183ce3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r--src/testlib/qtestcase.cpp41
1 files changed, 31 insertions, 10 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index b1bceb771c..8bd836d7f9 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -160,40 +160,61 @@ QT_BEGIN_NAMESPACE
\sa QVERIFY(), QTRY_COMPARE(), QTest::toString()
*/
-/*! \macro QTRY_VERIFY(condition)
+/*! \macro QTRY_VERIFY_WITH_TIMEOUT(condition, timeout)
\relates QTest
- The QTRY_VERIFY() macro is similar to QVERIFY(), but checks the \a condition
- repeatedly, until either the condition becomes true or a maximum timeout is
+ The QTRY_VERIFY_WITH_TIMEOUT() macro is similar to QVERIFY(), but checks the \a condition
+ repeatedly, until either the condition becomes true or the \a timeout is
reached. Between each evaluation, events will be processed. If the timeout
is reached, a failure is recorded in the test log and the test won't be
executed further.
- The timeout is fixed at five seconds.
+ \note This macro can only be used in a test function that is invoked
+ by the test framework.
+
+ \sa QTRY_VERIFY(), QVERIFY(), QCOMPARE(), QTRY_COMPARE()
+*/
+
+
+/*! \macro QTRY_VERIFY(condition)
+
+ \relates QTest
+
+ Invokes QTRY_VERIFY_WITH_TIMEOUT() with a timeout of five seconds.
\note This macro can only be used in a test function that is invoked
by the test framework.
- \sa QVERIFY(), QCOMPARE(), QTRY_COMPARE()
+ \sa QTRY_VERIFY_WITH_TIMEOUT(), QVERIFY(), QCOMPARE(), QTRY_COMPARE()
*/
-/*! \macro QTRY_COMPARE(actual, expected)
+/*! \macro QTRY_COMPARE_WITH_TIMEOUT(actual, expected, timeout)
\relates QTest
- The QTRY_COMPARE() macro is similar to QCOMPARE(), but performs the comparison
+ The QTRY_COMPARE_WITH_TIMEOUT() macro is similar to QCOMPARE(), but performs the comparison
of the \a actual and \a expected values repeatedly, until either the two values
- are equal or a maximum timeout is reached. Between each comparison, events
+ are equal or the \a timeout is reached. Between each comparison, events
will be processed. If the timeout is reached, a failure is recorded in the
test log and the test won't be executed further.
- The timeout is fixed at five seconds.
+ \note This macro can only be used in a test function that is invoked
+ by the test framework.
+
+ \sa QTRY_COMPARE(), QCOMPARE(), QVERIFY(), QTRY_VERIFY()
+*/
+
+/*! \macro QTRY_COMPARE(actual, expected)
+
+ \relates QTest
+
+ Invokes QTRY_COMPARE_WITH_TIMEOUT() with a timeout of five seconds.
\note This macro can only be used in a test function that is invoked
by the test framework.
- \sa QCOMPARE(), QVERIFY(), QTRY_VERIFY()
+ \sa QTRY_COMPARE_WITH_TIMEOUT(), QCOMPARE(), QVERIFY(), QTRY_VERIFY()
*/
/*! \macro QFETCH(type, name)