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

Unified Diff: tests/TestClassDef.h

Issue 117863005: Get rid of DEFINE_TESTCLASS_SHORT() macro. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Mike review Created 6 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/SkpSkGrTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/TestClassDef.h
diff --git a/tests/TestClassDef.h b/tests/TestClassDef.h
index 601603353c0021c1bca794499aab507fe82dcb4a..f874acc007f32638c58211245289d5314e1529d9 100644
--- a/tests/TestClassDef.h
+++ b/tests/TestClassDef.h
@@ -10,25 +10,26 @@
e.g.
#include "TestClassDef.h"
- DEFINE_TESTCLASS_SHORT(MyTestFunction)
- where MyTestFunction is declared as:
-
- static void MyTestFunction(skiatest::Reporter* reporter) {
+ DEF_TEST(some_test_name, r) {
+ ...
+ REPORTER_ASSERT(r, x == 15);
}
*/
-#define DEFINE_TESTCLASS_SHORT(function) \
- namespace skiatest { \
- class function##Class : public Test { \
- public: \
- static Test* Factory(void*) { return SkNEW(function##Class); } \
- protected: \
- virtual void onGetName(SkString* name) SK_OVERRIDE { name->set(#function); } \
- virtual void onRun(Reporter* reporter) SK_OVERRIDE { function(reporter); } \
- }; \
- static TestRegistry gReg_##function##Class(function##Class::Factory); \
- }
+#define DEF_TEST(name, reporter) \
+ static void name(skiatest::Reporter* reporter); \
+ namespace skiatest { \
+ class name##Class : public Test { \
+ public: \
+ static Test* Factory(void*) { return SkNEW(name##Class); } \
+ protected: \
+ virtual void onGetName(SkString* name) SK_OVERRIDE { name->set(#name); } \
+ virtual void onRun(Reporter* reporter) SK_OVERRIDE { name(reporter); } \
+ }; \
+ static TestRegistry gReg_##name##Class(name##Class::Factory); \
+ } \
+ static void name(skiatest::Reporter* reporter)
#define DEFINE_GPUTESTCLASS(uiname, classname, function) \
namespace skiatest { \
@@ -43,15 +44,3 @@
}; \
static TestRegistry gReg_##classname(classname::Factory); \
}
-
-
-// Yet shorter way to define a test. E.g.
-//
-// DEF_TEST(some_test_name, r) {
-// ...
-// REPORTER_ASSERT(r, x == 15);
-// }
-#define DEF_TEST(name, reporter) \
- static void name(skiatest::Reporter* reporter); \
- DEFINE_TESTCLASS_SHORT(name) \
- static void name(skiatest::Reporter* reporter)
« no previous file with comments | « tests/SkpSkGrTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698