| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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\t%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:%d\t%s: %s", __FILE__, __LINE__, \ |
| 106 r->reportFailed(desc); \ | 106 message, #cond); \ |
| 107 } \ | 107 r->reportFailed(desc); \ |
| 108 } \ |
| 108 } while(0) | 109 } while(0) |
| 109 | 110 |
| 111 #define ERRORF(reporter, ...) \ |
| 112 do { \ |
| 113 SkString desc; \ |
| 114 desc.printf("%s:%d\t", __FILE__, __LINE__); \ |
| 115 desc.appendf(__VA_ARGS__) ; \ |
| 116 (reporter)->reportFailed(desc); \ |
| 117 } while(0) |
| 110 | 118 |
| 111 #endif | 119 #endif |
| OLD | NEW |