Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: tests/Test.h

Issue 132843002: Add REPORTF test macro. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: final rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/StreamTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « tests/StreamTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698