From 8d0a524a4847bc7e1cc63a93b78922739466c201 Mon Sep 17 00:00:00 2001 From: "caryclark@google.com" Date: Tue, 16 Jul 2013 16:11:16 +0000 Subject: harden and speed up path op unit tests PathOps tests internal routines direcctly. Check to make sure that test points, lines, quads, curves, triangles, and bounds read from arrays are valid (i.e., don't contain NaN) before calling the test function. Repurpose the test flags. - make 'v' verbose test region output against path output - make 'z' single threaded (before it made it multithreaded) The latter change speeds up tests run by the buildbot by 2x to 3x. BUG= Review URL: https://codereview.chromium.org/19374003 git-svn-id: http://skia.googlecode.com/svn/trunk@10107 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/PathOpsQuadIntersectionTest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/PathOpsQuadIntersectionTest.cpp') diff --git a/tests/PathOpsQuadIntersectionTest.cpp b/tests/PathOpsQuadIntersectionTest.cpp index a060c8c067..ee2e8de8a1 100644 --- a/tests/PathOpsQuadIntersectionTest.cpp +++ b/tests/PathOpsQuadIntersectionTest.cpp @@ -5,6 +5,7 @@ * found in the LICENSE file. */ #include "PathOpsQuadIntersectionTestData.h" +#include "PathOpsTestCommon.h" #include "SkIntersections.h" #include "SkPathOpsRect.h" #include "SkReduceOrder.h" @@ -14,7 +15,9 @@ static void standardTestCases(skiatest::Reporter* reporter) { bool showSkipped = false; for (size_t index = 0; index < quadraticTests_count; ++index) { const SkDQuad& quad1 = quadraticTests[index][0]; + SkASSERT(ValidQuad(quad1)); const SkDQuad& quad2 = quadraticTests[index][1]; + SkASSERT(ValidQuad(quad2)); SkReduceOrder reduce1, reduce2; int order1 = reduce1.reduce(quad1, SkReduceOrder::kFill_Style); int order2 = reduce2.reduce(quad2, SkReduceOrder::kFill_Style); @@ -246,7 +249,9 @@ const size_t testSetCount = SK_ARRAY_COUNT(testSet); static void oneOffTest1(skiatest::Reporter* reporter, size_t outer, size_t inner) { const SkDQuad& quad1 = testSet[outer]; + SkASSERT(ValidQuad(quad1)); const SkDQuad& quad2 = testSet[inner]; + SkASSERT(ValidQuad(quad2)); SkIntersections intersections2; intersections2.intersect(quad1, quad2); for (int pt = 0; pt < intersections2.used(); ++pt) { @@ -291,7 +296,9 @@ const size_t coincidentTestSetCount = SK_ARRAY_COUNT(coincidentTestSet); static void coincidentTest(skiatest::Reporter* reporter) { for (size_t testIndex = 0; testIndex < coincidentTestSetCount - 1; testIndex += 2) { const SkDQuad& quad1 = coincidentTestSet[testIndex]; + SkASSERT(ValidQuad(quad1)); const SkDQuad& quad2 = coincidentTestSet[testIndex + 1]; + SkASSERT(ValidQuad(quad2)); SkIntersections intersections2; intersections2.intersect(quad1, quad2); REPORTER_ASSERT(reporter, intersections2.coincidentUsed() == 2); -- cgit v1.2.3