summaryrefslogtreecommitdiffstats
path: root/ppapi/tests/test_case.h
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/tests/test_case.h')
-rw-r--r--ppapi/tests/test_case.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/ppapi/tests/test_case.h b/ppapi/tests/test_case.h
index 0a3cdc6..06ebcb1 100644
--- a/ppapi/tests/test_case.h
+++ b/ppapi/tests/test_case.h
@@ -130,18 +130,24 @@ class TestCaseFactory {
// RunTest function. This assumes the function name is TestFoo where Foo is the
// test |name|.
#define RUN_TEST(name) \
- force_async_ = false; \
- instance_->LogTest(#name, Test##name());
+ do { \
+ force_async_ = false; \
+ instance_->LogTest(#name, Test##name()); \
+ } while (false)
// Like RUN_TEST above but forces functions taking callbacks to complete
// asynchronously on success or error.
#define RUN_TEST_FORCEASYNC(name) \
- force_async_ = true; \
- instance_->LogTest(#name"ForceAsync", Test##name());
+ do { \
+ force_async_ = true; \
+ instance_->LogTest(#name"ForceAsync", Test##name()); \
+ } while (false)
#define RUN_TEST_FORCEASYNC_AND_NOT(name) \
- RUN_TEST_FORCEASYNC(name); \
- RUN_TEST(name);
+ do { \
+ RUN_TEST_FORCEASYNC(name); \
+ RUN_TEST(name); \
+ } while (false)
// Helper macros for checking values in tests, and returning a location