diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-04-07 10:04:17 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-08 10:39:13 +0200 |
commit | 3a100edc4f912e0f8207e87282227135b90572b0 (patch) | |
tree | 6824932fa508146ce5a2a5ce8439f70840148823 /src/testlib | |
parent | 53c8a687b46f6ce8c24fabfe924758fe174b6922 (diff) |
QTestCase: fix macros taking expressions to avoid clang warnings
They were of the form "warning: using the result of an assignment
as a condition without parentheses [-Wparentheses]"
Change-Id: I049bf0f67073bf41310ca5ee73f17e5e69de569f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestcase.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index b715d83383..d9c8a43a2a 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -140,7 +140,7 @@ do {\ #define QTRY_TIMEOUT_DEBUG_IMPL(__expr, __timeoutValue, __step)\ if (!(__expr)) { \ - QTRY_LOOP_IMPL(__expr, (2 * __timeoutValue), __step);\ + QTRY_LOOP_IMPL((__expr), (2 * __timeoutValue), __step);\ if (__expr) { \ QString msg = QString::fromUtf8("QTestLib: This test case check (\"%1\") failed because the requested timeout (%2 ms) was too short, %3 ms would have been sufficient this time."); \ msg = msg.arg(QString::fromUtf8(#__expr)).arg(__timeoutValue).arg(__timeoutValue + __i); \ @@ -151,26 +151,26 @@ do {\ #define QTRY_IMPL(__expr, __timeout)\ const int __step = 50; \ const int __timeoutValue = __timeout; \ - QTRY_LOOP_IMPL(__expr, __timeoutValue, __step); \ - QTRY_TIMEOUT_DEBUG_IMPL(__expr, __timeoutValue, __step)\ + QTRY_LOOP_IMPL((__expr), __timeoutValue, __step); \ + QTRY_TIMEOUT_DEBUG_IMPL((__expr), __timeoutValue, __step)\ // Will try to wait for the expression to become true while allowing event processing #define QTRY_VERIFY_WITH_TIMEOUT(__expr, __timeout) \ do { \ - QTRY_IMPL(__expr, __timeout);\ + QTRY_IMPL((__expr), __timeout);\ QVERIFY(__expr); \ } while (0) -#define QTRY_VERIFY(__expr) QTRY_VERIFY_WITH_TIMEOUT(__expr, 5000) +#define QTRY_VERIFY(__expr) QTRY_VERIFY_WITH_TIMEOUT((__expr), 5000) // Will try to wait for the comparison to become successful while allowing event processing #define QTRY_COMPARE_WITH_TIMEOUT(__expr, __expected, __timeout) \ do { \ QTRY_IMPL(((__expr) == (__expected)), __timeout);\ - QCOMPARE(__expr, __expected); \ + QCOMPARE((__expr), __expected); \ } while (0) -#define QTRY_COMPARE(__expr, __expected) QTRY_COMPARE_WITH_TIMEOUT(__expr, __expected, 5000) +#define QTRY_COMPARE(__expr, __expected) QTRY_COMPARE_WITH_TIMEOUT((__expr), __expected, 5000) #define QSKIP_INTERNAL(statement) \ do {\ |