diff options
author | caryclark <caryclark@google.com> | 2016-10-20 08:32:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-20 08:32:18 -0700 |
commit | a35ab3e6e024d0b548ded26a2e3b8ecd838ead93 (patch) | |
tree | c009069f86b1129fcf5037ffc8e8fbf1b9ba010f /tests/PathOpsCubicLineIntersectionTest.cpp | |
parent | 65820db5e15201a3f30968420232d36c0ca89cd8 (diff) |
fix fuzzers
Many old pathops-related fuzz failures have built up while
the codebase was under a state a flux. Now that the code
is stable, address these failures.
Most of the CL plumbs the debug global state to downstream
routines so that, if the data is not trusted (ala fuzzed)
the function can safely exit without asserting.
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2426173002
Review-Url: https://chromiumcodereview.appspot.com/2426173002
Diffstat (limited to 'tests/PathOpsCubicLineIntersectionTest.cpp')
-rw-r--r-- | tests/PathOpsCubicLineIntersectionTest.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/PathOpsCubicLineIntersectionTest.cpp b/tests/PathOpsCubicLineIntersectionTest.cpp index a2b870d000..a6ae5e6441 100644 --- a/tests/PathOpsCubicLineIntersectionTest.cpp +++ b/tests/PathOpsCubicLineIntersectionTest.cpp @@ -12,7 +12,7 @@ #include "Test.h" struct lineCubic { - SkDCubic cubic; + CubicPts cubic; SkDLine line; }; @@ -25,7 +25,9 @@ static lineCubic failLineCubicTests[] = { static const size_t failLineCubicTests_count = SK_ARRAY_COUNT(failLineCubicTests); static void testFail(skiatest::Reporter* reporter, int iIndex) { - const SkDCubic& cubic = failLineCubicTests[iIndex].cubic; + const CubicPts& cuPts = failLineCubicTests[iIndex].cubic; + SkDCubic cubic; + cubic.debugSet(cuPts.fPts); SkASSERT(ValidCubic(cubic)); const SkDLine& line = failLineCubicTests[iIndex].line; SkASSERT(ValidLine(line)); @@ -123,7 +125,9 @@ static int doIntersect(SkIntersections& intersections, const SkDCubic& cubic, co } static void testOne(skiatest::Reporter* reporter, int iIndex) { - const SkDCubic& cubic = lineCubicTests[iIndex].cubic; + const CubicPts& cuPts = lineCubicTests[iIndex].cubic; + SkDCubic cubic; + cubic.debugSet(cuPts.fPts); SkASSERT(ValidCubic(cubic)); const SkDLine& line = lineCubicTests[iIndex].line; SkASSERT(ValidLine(line)); @@ -188,7 +192,9 @@ DEF_TEST(PathOpsCubicLineIntersection, reporter) { DEF_TEST(PathOpsCubicLineIntersectionOneOff, reporter) { int iIndex = 0; testOne(reporter, iIndex); - const SkDCubic& cubic = lineCubicTests[iIndex].cubic; + const CubicPts& cuPts = lineCubicTests[iIndex].cubic; + SkDCubic cubic; + cubic.debugSet(cuPts.fPts); const SkDLine& line = lineCubicTests[iIndex].line; SkIntersections i; i.intersect(cubic, line); |