From 78e7b4e1b928fa69f672be3c743df6d6c3ecbced Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Thu, 2 Jan 2014 21:45:03 +0000 Subject: Get rid of DEFINE_TESTCLASS_SHORT() macro. Instead tests should be written using DEF_TEST() macro, which is much nicer and simplifies the process of setting up an unit test. BUG=None TEST=skpskgr_test, pathops_unittest R=mtklein@google.com Review URL: https://codereview.chromium.org/117863005 git-svn-id: http://skia.googlecode.com/svn/trunk@12870 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/PathOpsLineIntersectionTest.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'tests/PathOpsLineIntersectionTest.cpp') diff --git a/tests/PathOpsLineIntersectionTest.cpp b/tests/PathOpsLineIntersectionTest.cpp index 9934731f7e..3633262115 100644 --- a/tests/PathOpsLineIntersectionTest.cpp +++ b/tests/PathOpsLineIntersectionTest.cpp @@ -8,6 +8,7 @@ #include "SkIntersections.h" #include "SkPathOpsLine.h" #include "Test.h" +#include "TestClassDef.h" // FIXME: add tests for intersecting, non-intersecting, degenerate, coincident static const SkDLine tests[][2] = { @@ -178,7 +179,7 @@ static void testOneCoincident(skiatest::Reporter* reporter, const SkDLine& line1 reporter->bumpTestCount(); } -static void PathOpsLineIntersectionTest(skiatest::Reporter* reporter) { +DEF_TEST(PathOpsLineIntersection, reporter) { size_t index; for (index = 0; index < coincidentTests_count; ++index) { const SkDLine& line1 = coincidentTests[index][0]; @@ -201,24 +202,17 @@ static void PathOpsLineIntersectionTest(skiatest::Reporter* reporter) { } } -static void PathOpsLineIntersectionOneOffTest(skiatest::Reporter* reporter) { +DEF_TEST(PathOpsLineIntersectionOneOff, reporter) { int index = 0; SkASSERT(index < (int) tests_count); testOne(reporter, tests[index][0], tests[index][1]); testOne(reporter, tests[1][0], tests[1][1]); } -static void PathOpsLineIntersectionOneCoincidentTest(skiatest::Reporter* reporter) { +DEF_TEST(PathOpsLineIntersectionOneCoincident, reporter) { int index = 0; SkASSERT(index < (int) coincidentTests_count); const SkDLine& line1 = coincidentTests[index][0]; const SkDLine& line2 = coincidentTests[index][1]; testOneCoincident(reporter, line1, line2); } - -#include "TestClassDef.h" -DEFINE_TESTCLASS_SHORT(PathOpsLineIntersectionTest) - -DEFINE_TESTCLASS_SHORT(PathOpsLineIntersectionOneOffTest) - -DEFINE_TESTCLASS_SHORT(PathOpsLineIntersectionOneCoincidentTest) -- cgit v1.2.3