OLD | NEW |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 GrContextFactory* factory); | 87 GrContextFactory* factory); |
88 } // namespace skiatest | 88 } // namespace skiatest |
89 | 89 |
90 #define REPORTER_ASSERT(r, cond) \ | 90 #define REPORTER_ASSERT(r, cond) \ |
91 do { \ | 91 do { \ |
92 if (!(cond)) { \ | 92 if (!(cond)) { \ |
93 REPORT_FAILURE(r, #cond, SkString()); \ | 93 REPORT_FAILURE(r, #cond, SkString()); \ |
94 } \ | 94 } \ |
95 } while (0) | 95 } while (0) |
96 | 96 |
97 #define REPORTER_ASSERT_MESSAGE(r, cond, message) \ | 97 #define REPORTER_ASSERT_MESSAGE(r, cond, ...) \ |
98 do { \ | 98 do { \ |
99 if (!(cond)) { \ | 99 if (!(cond)) { \ |
100 REPORT_FAILURE(r, #cond, SkString(message)); \ | 100 REPORT_FAILURE(r, #cond, SkStringPrintf(__VA_ARGS__)); \ |
101 } \ | 101 } \ |
102 } while (0) | 102 } while (0) |
103 | 103 |
104 #define ERRORF(r, ...) \ | 104 #define ERRORF(r, ...) \ |
105 do { \ | 105 do { \ |
106 REPORT_FAILURE(r, "", SkStringPrintf(__VA_ARGS__)); \ | 106 REPORT_FAILURE(r, "", SkStringPrintf(__VA_ARGS__)); \ |
107 } while (0) | 107 } while (0) |
108 | 108 |
109 #define INFOF(REPORTER, ...) \ | 109 #define INFOF(REPORTER, ...) \ |
110 do { \ | 110 do { \ |
111 if ((REPORTER)->verbose()) { \ | 111 if ((REPORTER)->verbose()) { \ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 do { \ | 158 do { \ |
159 SkDynamicMemoryWStream testStream; \ | 159 SkDynamicMemoryWStream testStream; \ |
160 SkAutoTUnref<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \ | 160 SkAutoTUnref<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \ |
161 if (!testDoc) { \ | 161 if (!testDoc) { \ |
162 INFOF(REPORTER, "PDF disabled; %s test skipped.", #TEST_NAME); \ | 162 INFOF(REPORTER, "PDF disabled; %s test skipped.", #TEST_NAME); \ |
163 return; \ | 163 return; \ |
164 } \ | 164 } \ |
165 } while (false) | 165 } while (false) |
166 | 166 |
167 #endif | 167 #endif |
OLD | NEW |