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

Side by Side Diff: tests/Test.h

Issue 14002007: allow tests to optionally use multiple threads (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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/PathOpsSimplifyTrianglesThreadedTest.cpp ('k') | tests/skia_test.cpp » ('j') | 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 25 matching lines...) Expand all
36 int countTests() const { return fTestCount; } 36 int countTests() const { return fTestCount; }
37 int countResults(Result r) { 37 int countResults(Result r) {
38 SkASSERT((unsigned)r <= kLastResult); 38 SkASSERT((unsigned)r <= kLastResult);
39 return fResultCount[r]; 39 return fResultCount[r];
40 } 40 }
41 41
42 void startTest(Test*); 42 void startTest(Test*);
43 void report(const char testDesc[], Result); 43 void report(const char testDesc[], Result);
44 void endTest(Test*); 44 void endTest(Test*);
45 virtual bool allowExtendedTest() const { return false; } 45 virtual bool allowExtendedTest() const { return false; }
46 46 virtual bool allowThreaded() const { return false; }
47 // helpers for tests 47 // helpers for tests
48 void assertTrue(bool cond, const char desc[]) { 48 void assertTrue(bool cond, const char desc[]) {
49 if (!cond) { 49 if (!cond) {
50 this->report(desc, kFailed); 50 this->report(desc, kFailed);
51 } 51 }
52 } 52 }
53 void assertFalse(bool cond, const char desc[]) { 53 void assertFalse(bool cond, const char desc[]) {
54 if (cond) { 54 if (cond) {
55 this->report(desc, kFailed); 55 this->report(desc, kFailed);
56 } 56 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 do { \ 128 do { \
129 if (!(cond)) { \ 129 if (!(cond)) { \
130 SkString desc; \ 130 SkString desc; \
131 desc.printf("%s %s:%d: %s", message, __FILE__, __LINE__, #cond); \ 131 desc.printf("%s %s:%d: %s", message, __FILE__, __LINE__, #cond); \
132 r->reportFailed(desc); \ 132 r->reportFailed(desc); \
133 } \ 133 } \
134 } while(0) 134 } while(0)
135 135
136 136
137 #endif 137 #endif
OLDNEW
« no previous file with comments | « tests/PathOpsSimplifyTrianglesThreadedTest.cpp ('k') | tests/skia_test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698