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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 } while(0) | 131 } while(0) |
132 | 132 |
133 #define ERRORF(reporter, ...) \ | 133 #define ERRORF(reporter, ...) \ |
134 do { \ | 134 do { \ |
135 SkString desc; \ | 135 SkString desc; \ |
136 desc.printf("%s:%d\t", __FILE__, __LINE__); \ | 136 desc.printf("%s:%d\t", __FILE__, __LINE__); \ |
137 desc.appendf(__VA_ARGS__) ; \ | 137 desc.appendf(__VA_ARGS__) ; \ |
138 (reporter)->reportFailed(desc); \ | 138 (reporter)->reportFailed(desc); \ |
139 } while(0) | 139 } while(0) |
140 | 140 |
141 #define DEF_TEST(name, reporter) \ | 141 #define DEF_TEST(name, reporter) \ |
142 static void name(skiatest::Reporter*); \ | 142 static void Test##name(skiatest::Reporter*); \ |
mtklein
2014/06/23 17:18:21
Let's do test_##name to match the style guide for
tfarina
2014/06/23 22:47:32
Done.
| |
143 namespace skiatest { \ | 143 namespace skiatest { \ |
144 class name##Class : public Test { \ | 144 class name##Class : public Test { \ |
145 public: \ | 145 public: \ |
146 static Test* Factory(void*) { return SkNEW(name##Class); } \ | 146 static Test* Factory(void*) { return SkNEW(name##Class); } \ |
147 protected: \ | 147 protected: \ |
148 virtual void onGetName(SkString* name) SK_OVERRIDE { \ | 148 virtual void onGetName(SkString* name) SK_OVERRIDE { \ |
149 name->set(#name); \ | 149 name->set(#name); \ |
150 } \ | 150 } \ |
151 virtual void onRun(Reporter* r) SK_OVERRIDE { name(r); } \ | 151 virtual void onRun(Reporter* r) SK_OVERRIDE { Test##name(r); } \ |
152 }; \ | 152 }; \ |
153 static TestRegistry gReg_##name##Class(name##Class::Factory); \ | 153 static TestRegistry gReg_##name##Class(name##Class::Factory); \ |
154 } \ | 154 } \ |
155 static void name(skiatest::Reporter* reporter) | 155 static void Test##name(skiatest::Reporter* reporter) |
156 | 156 |
157 #define DEF_GPUTEST(name, reporter, factory) \ | 157 #define DEF_GPUTEST(name, reporter, factory) \ |
158 static void name(skiatest::Reporter*, GrContextFactory*); \ | 158 static void Test##name(skiatest::Reporter*, GrContextFactory*); \ |
159 namespace skiatest { \ | 159 namespace skiatest { \ |
160 class name##Class : public GpuTest { \ | 160 class name##Class : public GpuTest { \ |
161 public: \ | 161 public: \ |
162 static Test* Factory(void*) { return SkNEW(name##Class); } \ | 162 static Test* Factory(void*) { return SkNEW(name##Class); } \ |
163 protected: \ | 163 protected: \ |
164 virtual void onGetName(SkString* name) SK_OVERRIDE { \ | 164 virtual void onGetName(SkString* name) SK_OVERRIDE { \ |
165 name->set(#name); \ | 165 name->set(#name); \ |
166 } \ | 166 } \ |
167 virtual void onRun(Reporter* r) SK_OVERRIDE { \ | 167 virtual void onRun(Reporter* r) SK_OVERRIDE { \ |
168 name(r, fGrContextFactory); \ | 168 Test##name(r, fGrContextFactory); \ |
169 } \ | 169 } \ |
170 }; \ | 170 }; \ |
171 static TestRegistry gReg_##name##Class(name##Class::Factory); \ | 171 static TestRegistry gReg_##name##Class(name##Class::Factory); \ |
172 } \ | 172 } \ |
173 static void name(skiatest::Reporter* reporter, GrContextFactory* factory) | 173 static void Test##name(skiatest::Reporter* reporter, GrContextFactory* facto ry) |
174 | 174 |
175 #endif | 175 #endif |
OLD | NEW |