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/PathOpsCubicIntersectionTestData.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/PathOpsCubicIntersectionTestData.cpp')
-rw-r--r-- | tests/PathOpsCubicIntersectionTestData.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/PathOpsCubicIntersectionTestData.cpp b/tests/PathOpsCubicIntersectionTestData.cpp index 7f725ef9fd..58dbfde3d1 100644 --- a/tests/PathOpsCubicIntersectionTestData.cpp +++ b/tests/PathOpsCubicIntersectionTestData.cpp @@ -14,7 +14,7 @@ static const double G = FLT_EPSILON / 3; static const double N = -FLT_EPSILON / 2; static const double M = -FLT_EPSILON / 3; -const SkDCubic pointDegenerates[] = { +const CubicPts pointDegenerates[] = { {{{0, 0}, {0, 0}, {0, 0}, {0, 0}}}, {{{1, 1}, {1, 1}, {1, 1}, {1, 1}}}, {{{1 + FLT_EPSILON_HALF, 1}, {1, 1 + FLT_EPSILON_HALF}, {1, 1}, {1, 1}}}, @@ -45,7 +45,7 @@ const SkDCubic pointDegenerates[] = { const size_t pointDegenerates_count = SK_ARRAY_COUNT(pointDegenerates); -const SkDCubic notPointDegenerates[] = { +const CubicPts notPointDegenerates[] = { {{{1 + FLT_EPSILON * 8, 1}, {1, FLT_EPSILON * 8}, {1, 1}, {1, 1}}}, {{{1 + FLT_EPSILON * 8, 1}, {1 - FLT_EPSILON * 8, 1}, {1, 1}, {1, 1}}} }; @@ -54,7 +54,7 @@ const size_t notPointDegenerates_count = SK_ARRAY_COUNT(notPointDegenerates); // from http://www.truetex.com/bezint.htm -const SkDCubic tests[][2] = { +const CubicPts tests[][2] = { { // intersects in one place (data gives bezier clip fits {{{0, 45}, {6.0094158284751593, 51.610357411322688}, @@ -109,7 +109,7 @@ const SkDCubic tests[][2] = { const size_t tests_count = SK_ARRAY_COUNT(tests); -const SkDCubic lines[] = { +const CubicPts lines[] = { {{{0, 0}, {0, 0}, {0, 0}, {1, 0}}}, // 0: horizontal {{{1, 0}, {0, 0}, {0, 0}, {0, 0}}}, {{{1, 0}, {2, 0}, {3, 0}, {4, 0}}}, @@ -145,7 +145,7 @@ const SkDCubic lines[] = { const size_t lines_count = SK_ARRAY_COUNT(lines); // 'not a line' tries to fool the line detection code -const SkDCubic notLines[] = { +const CubicPts notLines[] = { {{{0, 0}, {0, 0}, {0, 1}, {1, 0}}}, {{{0, 0}, {0, 1}, {0, 0}, {1, 0}}}, {{{0, 0}, {0, 1}, {1, 0}, {0, 0}}}, @@ -159,7 +159,7 @@ const size_t notLines_count = SK_ARRAY_COUNT(notLines); static const double E = FLT_EPSILON * 8; static const double F = FLT_EPSILON * 8; -const SkDCubic modEpsilonLines[] = { +const CubicPts modEpsilonLines[] = { {{{0, E}, {0, 0}, {0, 0}, {1, 0}}}, // horizontal {{{0, 0}, {0, E}, {1, 0}, {0, 0}}}, {{{0, 0}, {1, 0}, {0, E}, {0, 0}}}, @@ -202,7 +202,7 @@ const SkDCubic modEpsilonLines[] = { const size_t modEpsilonLines_count = SK_ARRAY_COUNT(modEpsilonLines); -const SkDCubic lessEpsilonLines[] = { +const CubicPts lessEpsilonLines[] = { {{{0, D}, {0, 0}, {0, 0}, {1, 0}}}, // horizontal {{{1, 0}, {0, 0}, {0, 0}, {0, D}}}, {{{1, D}, {2, 0}, {3, 0}, {4, 0}}}, @@ -238,7 +238,7 @@ const SkDCubic lessEpsilonLines[] = { const size_t lessEpsilonLines_count = SK_ARRAY_COUNT(lessEpsilonLines); -const SkDCubic negEpsilonLines[] = { +const CubicPts negEpsilonLines[] = { {{{0, N}, {0, 0}, {0, 0}, {1, 0}}}, // horizontal {{{1, 0}, {0, 0}, {0, 0}, {0, N}}}, {{{1, N}, {2, 0}, {3, 0}, {4, 0}}}, |