diff options
author | 2016-10-20 08:32:18 -0700 | |
---|---|---|
committer | 2016-10-20 08:32:18 -0700 | |
commit | a35ab3e6e024d0b548ded26a2e3b8ecd838ead93 (patch) | |
tree | c009069f86b1129fcf5037ffc8e8fbf1b9ba010f /tests/PathOpsCubicQuadIntersectionTest.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/PathOpsCubicQuadIntersectionTest.cpp')
-rw-r--r-- | tests/PathOpsCubicQuadIntersectionTest.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/PathOpsCubicQuadIntersectionTest.cpp b/tests/PathOpsCubicQuadIntersectionTest.cpp index 98665af517..87c7e13d8a 100644 --- a/tests/PathOpsCubicQuadIntersectionTest.cpp +++ b/tests/PathOpsCubicQuadIntersectionTest.cpp @@ -13,8 +13,8 @@ #include "Test.h" static struct quadCubic { - SkDCubic cubic; - SkDQuad quad; + CubicPts cubic; + QuadPts quad; } quadCubicTests[] = { {{{{945.08099365234375, 747.1619873046875}, {982.5679931640625, 747.1619873046875}, {1013.6290283203125, 719.656005859375}, {1019.1910400390625, 683.72601318359375}}}, {{{945, 747}, {976.0660400390625, 747}, {998.03302001953125, 725.03302001953125}}}}, @@ -53,9 +53,13 @@ static const int quadCubicTests_count = (int) SK_ARRAY_COUNT(quadCubicTests); static void cubicQuadIntersection(skiatest::Reporter* reporter, int index) { int iIndex = static_cast<int>(index); - const SkDCubic& cubic = quadCubicTests[index].cubic; + const CubicPts& c = quadCubicTests[index].cubic; + SkDCubic cubic; + cubic.debugSet(c.fPts); SkASSERT(ValidCubic(cubic)); - const SkDQuad& quad = quadCubicTests[index].quad; + const QuadPts& q = quadCubicTests[index].quad; + SkDQuad quad; + quad.debugSet(q.fPts); SkASSERT(ValidQuad(quad)); SkReduceOrder reduce1; SkReduceOrder reduce2; |