Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1196)

Unified Diff: tests/Test.h

Issue 132843002: Add REPORTF test macro. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: final rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/StreamTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/Test.h
diff --git a/tests/Test.h b/tests/Test.h
index 1c89f98e09f437ada747dcbbbecd62cca0a114c2..ff6b4ac82c2a30c32f8d5cbc7de97cdd49932284 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -89,23 +89,31 @@ namespace skiatest {
typedef SkTRegistry<Test*(*)(void*)> TestRegistry;
}
-#define REPORTER_ASSERT(r, cond) \
- do { \
- if (!(cond)) { \
- SkString desc; \
- desc.printf("%s:%d: %s", __FILE__, __LINE__, #cond); \
- r->reportFailed(desc); \
- } \
+#define REPORTER_ASSERT(r, cond) \
+ do { \
+ if (!(cond)) { \
+ SkString desc; \
+ desc.printf("%s:%d\t%s", __FILE__, __LINE__, #cond); \
+ r->reportFailed(desc); \
+ } \
} while(0)
-#define REPORTER_ASSERT_MESSAGE(r, cond, message) \
- do { \
- if (!(cond)) { \
- SkString desc; \
- desc.printf("%s %s:%d: %s", message, __FILE__, __LINE__, #cond); \
- r->reportFailed(desc); \
- } \
+#define REPORTER_ASSERT_MESSAGE(r, cond, message) \
+ do { \
+ if (!(cond)) { \
+ SkString desc; \
+ desc.printf("%s:%d\t%s: %s", __FILE__, __LINE__, \
+ message, #cond); \
+ r->reportFailed(desc); \
+ } \
} while(0)
+#define ERRORF(reporter, ...) \
+ do { \
+ SkString desc; \
+ desc.printf("%s:%d\t", __FILE__, __LINE__); \
+ desc.appendf(__VA_ARGS__) ; \
+ (reporter)->reportFailed(desc); \
+ } while(0)
#endif
« no previous file with comments | « tests/StreamTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698