test: fix macro by adding in missing "do" in do-while
PATCH 1/1 test: fix macro by adding in missing "do" in do-while
One of the test assertion macros was missing the "do" part of the do-while. This issue was picked up by clang reporting an empty while loop body for the closing while of the do-while pair.
Signed-off-by Bruce Richardson <[email protected]>
--- app/test/test.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test.h +1 -1
@@ -44,7 +44,7 @@ } \ } while (0) -#define TEST_ASSERT_EQUAL (a, b, msg, ...) { \ +#define TEST_ASSERT_EQUAL (a, b, msg, ...) do { \ if (!(a == b)) { \ printf("TestCase %s() line %d failed: " \ msg "\n", __func__, __LINE__, ##__VA_ARGS__); \
Signature · 1 line
2.1.0
Thomas Monjalon
Applied2014-12-17 17:06, Bruce Richardson:
Quoted 5 lines
One of the test assertion macros was missing the "do" part of the do-while. This issue was picked up by clang reporting an empty while loop body for the closing while of the do-while pair.
Signed-off-by Bruce Richardson <[email protected]>
Applied
Thanks
Signature · 1 line
Thomas