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/PathOpsLineParametetersTest.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/PathOpsLineParametetersTest.cpp')
-rw-r--r-- | tests/PathOpsLineParametetersTest.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/PathOpsLineParametetersTest.cpp b/tests/PathOpsLineParametetersTest.cpp index aab1f7a961..66a4be2a05 100644 --- a/tests/PathOpsLineParametetersTest.cpp +++ b/tests/PathOpsLineParametetersTest.cpp @@ -9,7 +9,7 @@ #include "Test.h" // tests to verify that distance calculations are coded correctly -static const SkDCubic tests[] = { +static const CubicPts tests[] = { {{{0, 0}, {1, 1}, {2, 2}, {0, 3}}}, {{{0, 0}, {1, 1}, {2, 2}, {3, 0}}}, {{{0, 0}, {5, 0}, {-2, 4}, {3, 4}}}, @@ -40,7 +40,9 @@ static const size_t tests_count = SK_ARRAY_COUNT(tests); DEF_TEST(PathOpsLineParameters, reporter) { for (size_t index = 0; index < tests_count; ++index) { SkLineParameters lineParameters; - const SkDCubic& cubic = tests[index]; + const CubicPts& c = tests[index]; + SkDCubic cubic; + cubic.debugSet(c.fPts); SkASSERT(ValidCubic(cubic)); lineParameters.cubicEndPoints(cubic, 0, 3); double denormalizedDistance[2]; |