diff options
author | 2016-10-20 08:32:18 -0700 | |
---|---|---|
committer | 2016-10-20 08:32:18 -0700 | |
commit | a35ab3e6e024d0b548ded26a2e3b8ecd838ead93 (patch) | |
tree | c009069f86b1129fcf5037ffc8e8fbf1b9ba010f /tests/PathOpsThreeWayTest.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/PathOpsThreeWayTest.cpp')
-rw-r--r-- | tests/PathOpsThreeWayTest.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/PathOpsThreeWayTest.cpp b/tests/PathOpsThreeWayTest.cpp index 6a93bfbc59..b86ff65c8b 100644 --- a/tests/PathOpsThreeWayTest.cpp +++ b/tests/PathOpsThreeWayTest.cpp @@ -4,6 +4,7 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ +#include "PathOpsTestCommon.h" #include "SkIntersections.h" #include "SkTDArray.h" #include "Test.h" @@ -12,7 +13,7 @@ struct Curve { int ptCount; - SkDCubic curve; // largest can hold lines / quads/ cubics + CubicPts curve; // largest can hold lines / quads/ cubics }; static const Curve testSet0[] = { // extracted from skpClip2 @@ -49,16 +50,19 @@ static void testSetTest(skiatest::Reporter* reporter, int index) { const Curve& iTest = testSet.tests[inner]; SkIntersections* i = combos.append(); sk_bzero(i, sizeof(SkIntersections)); - SkDLine oLine = {{ oTest.curve[0], oTest.curve[1] }}; - SkDLine iLine = {{ iTest.curve[0], iTest.curve[1] }}; + SkDLine oLine = {{ oTest.curve.fPts[0], oTest.curve.fPts[1] }}; + SkDLine iLine = {{ iTest.curve.fPts[0], iTest.curve.fPts[1] }}; + SkDCubic iCurve, oCurve; + iCurve.debugSet(iTest.curve.fPts); + oCurve.debugSet(oTest.curve.fPts); if (oTest.ptCount == 1 && iTest.ptCount == 1) { i->intersect(oLine, iLine); } else if (oTest.ptCount == 1 && iTest.ptCount == 4) { - i->intersect(iTest.curve, oLine); + i->intersect(iCurve, oLine); } else if (oTest.ptCount == 4 && iTest.ptCount == 1) { - i->intersect(oTest.curve, iLine); + i->intersect(oCurve, iLine); } else if (oTest.ptCount == 4 && iTest.ptCount == 4) { - i->intersect(oTest.curve, iTest.curve); + i->intersect(oCurve, iCurve); } else { SkASSERT(0); } |