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

Side by Side Diff: tests/Test.h

Issue 132843002: Add REPORTF test macro. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: factor 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/StreamTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef skiatest_Test_DEFINED 8 #ifndef skiatest_Test_DEFINED
9 #define skiatest_Test_DEFINED 9 #define skiatest_Test_DEFINED
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 #define REPORTER_ASSERT_MESSAGE(r, cond, message) \ 101 #define REPORTER_ASSERT_MESSAGE(r, cond, message) \
102 do { \ 102 do { \
103 if (!(cond)) { \ 103 if (!(cond)) { \
104 SkString desc; \ 104 SkString desc; \
105 desc.printf("%s %s:%d: %s", message, __FILE__, __LINE__, #cond); \ 105 desc.printf("%s %s:%d: %s", message, __FILE__, __LINE__, #cond); \
106 r->reportFailed(desc); \ 106 r->reportFailed(desc); \
107 } \ 107 } \
108 } while(0) 108 } while(0)
109 109
110 #define REPORTF(REPORTER, PRINTF_ARGS) \
mtklein 2014/01/10 14:03:58 Generally, arguments to macros don't need to be ca
mtklein 2014/01/10 14:03:58 If you write this as #define REPORTF(REPORTER, ..
hal.canary 2014/01/10 14:50:31 Done.
hal.canary 2014/01/10 14:50:31 Done.
111 do { \
112 SkString message; \
113 message.printf PRINTF_ARGS ; \
114 message.appendf(" %s:%d", __FILE__, __LINE__); \
mtklein 2014/01/10 14:03:58 I'd prefer file:line to come first. It's nice to
hal.canary 2014/01/10 14:50:31 Done.
115 (REPORTER)->reportFailed(message); \
mtklein 2014/01/10 14:03:58 We may want to follow up and make reportFailed mor
hal.canary 2014/01/10 14:50:31 Done.
116 } while(0)
110 117
111 #endif 118 #endif
OLDNEW
« 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