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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 class GpuTest : public Test{ | 80 class GpuTest : public Test{ |
81 public: | 81 public: |
82 GpuTest() : Test() {} | 82 GpuTest() : Test() {} |
83 static GrContextFactory* GetGrContextFactory(); | 83 static GrContextFactory* GetGrContextFactory(); |
84 static void DestroyContexts(); | 84 static void DestroyContexts(); |
85 virtual bool isThreadsafe() const { return false; } | 85 virtual bool isThreadsafe() const { return false; } |
86 private: | 86 private: |
87 }; | 87 }; |
88 | 88 |
89 typedef SkTRegistry<Test*, void*> TestRegistry; | 89 typedef SkTRegistry<Test*(*)(void*)> TestRegistry; |
90 } | 90 } |
91 | 91 |
92 #define REPORTER_ASSERT(r, cond) \ | 92 #define REPORTER_ASSERT(r, cond) \ |
93 do { \ | 93 do { \ |
94 if (!(cond)) { \ | 94 if (!(cond)) { \ |
95 SkString desc; \ | 95 SkString desc; \ |
96 desc.printf("%s:%d: %s", __FILE__, __LINE__, #cond); \ | 96 desc.printf("%s:%d: %s", __FILE__, __LINE__, #cond); \ |
97 r->reportFailed(desc); \ | 97 r->reportFailed(desc); \ |
98 } \ | 98 } \ |
99 } while(0) | 99 } while(0) |
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 | 110 |
111 #endif | 111 #endif |
OLD | NEW |