| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 r->reportFailed(failure); \ | 171 r->reportFailed(failure); \ |
| 172 } while(0) | 172 } while(0) |
| 173 | 173 |
| 174 #define DEF_TEST(name, reporter) \ | 174 #define DEF_TEST(name, reporter) \ |
| 175 static void test_##name(skiatest::Reporter*); \ | 175 static void test_##name(skiatest::Reporter*); \ |
| 176 namespace skiatest { \ | 176 namespace skiatest { \ |
| 177 class name##Class : public Test { \ | 177 class name##Class : public Test { \ |
| 178 public: \ | 178 public: \ |
| 179 static Test* Factory(void*) { return SkNEW(name##Class); } \ | 179 static Test* Factory(void*) { return SkNEW(name##Class); } \ |
| 180 protected: \ | 180 protected: \ |
| 181 virtual void onGetName(SkString* name) SK_OVERRIDE { \ | 181 void onGetName(SkString* name) SK_OVERRIDE { \ |
| 182 name->set(#name); \ | 182 name->set(#name); \ |
| 183 } \ | 183 } \ |
| 184 virtual void onRun(Reporter* r) SK_OVERRIDE { test_##name(r); } \ | 184 void onRun(Reporter* r) SK_OVERRIDE { test_##name(r); } \ |
| 185 }; \ | 185 }; \ |
| 186 static TestRegistry gReg_##name##Class(name##Class::Factory); \ | 186 static TestRegistry gReg_##name##Class(name##Class::Factory); \ |
| 187 } \ | 187 } \ |
| 188 static void test_##name(skiatest::Reporter* reporter) | 188 static void test_##name(skiatest::Reporter* reporter) |
| 189 | 189 |
| 190 #define DEF_GPUTEST(name, reporter, factory) \ | 190 #define DEF_GPUTEST(name, reporter, factory) \ |
| 191 static void test_##name(skiatest::Reporter*, GrContextFactory*); \ | 191 static void test_##name(skiatest::Reporter*, GrContextFactory*); \ |
| 192 namespace skiatest { \ | 192 namespace skiatest { \ |
| 193 class name##Class : public GpuTest { \ | 193 class name##Class : public GpuTest { \ |
| 194 public: \ | 194 public: \ |
| 195 static Test* Factory(void*) { return SkNEW(name##Class); } \ | 195 static Test* Factory(void*) { return SkNEW(name##Class); } \ |
| 196 protected: \ | 196 protected: \ |
| 197 virtual void onGetName(SkString* name) SK_OVERRIDE { \ | 197 void onGetName(SkString* name) SK_OVERRIDE { \ |
| 198 name->set(#name); \ | 198 name->set(#name); \ |
| 199 } \ | 199 } \ |
| 200 virtual void onRun(Reporter* r) SK_OVERRIDE { \ | 200 void onRun(Reporter* r) SK_OVERRIDE { \ |
| 201 test_##name(r, fGrContextFactory); \ | 201 test_##name(r, fGrContextFactory); \ |
| 202 } \ | 202 } \ |
| 203 }; \ | 203 }; \ |
| 204 static TestRegistry gReg_##name##Class(name##Class::Factory); \ | 204 static TestRegistry gReg_##name##Class(name##Class::Factory); \ |
| 205 } \ | 205 } \ |
| 206 static void test_##name(skiatest::Reporter* reporter, GrContextFactory* fact
ory) | 206 static void test_##name(skiatest::Reporter* reporter, GrContextFactory* fact
ory) |
| 207 | 207 |
| 208 #endif | 208 #endif |
| OLD | NEW |