aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Test.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-01-29 09:50:47 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-29 15:17:09 +0000
commit1c80e99dd5b23ebc3f10c768857a21887ab9f090 (patch)
tree491fa16698ffb07569718ef49cbb7ac8f9562374 /tests/Test.h
parent5effc281c70e111b3c5e9da9882c1981699af26f (diff)
Allow printf style var args for messages in REPORTER_ASSERT.
Remove REPORTER_ASSERT_MESSAGE. Change-Id: I6d00715901159c93e22d182fe24aac92b5fdbcf4 Reviewed-on: https://skia-review.googlesource.com/100361 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tests/Test.h')
-rw-r--r--tests/Test.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/Test.h b/tests/Test.h
index fc47d25932..f74b98aa9c 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -123,7 +123,7 @@ typedef sk_tools::Registry<Test> TestRegistry;
...
REPORTER_ASSERT(reporter, x == 15);
...
- REPORTER_ASSERT_MESSAGE(reporter, x == 15, "x should be 15");
+ REPORTER_ASSERT(reporter, x == 15, "x should be 15");
...
if (x != 15) {
ERRORF(reporter, "x should be 15, but is %d", x);
@@ -171,18 +171,11 @@ private:
} // namespace skiatest
-#define REPORTER_ASSERT(r, cond) \
- do { \
- if (!(cond)) { \
- REPORT_FAILURE(r, #cond, SkString()); \
- } \
- } while (0)
-
-#define REPORTER_ASSERT_MESSAGE(r, cond, message) \
- do { \
- if (!(cond)) { \
- REPORT_FAILURE(r, #cond, SkString(message)); \
- } \
+#define REPORTER_ASSERT(r, cond, ...) \
+ do { \
+ if (!(cond)) { \
+ REPORT_FAILURE(r, #cond, SkStringPrintf(__VA_ARGS__)); \
+ } \
} while (0)
#define ERRORF(r, ...) \