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/PathOpsDRectTest.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/PathOpsDRectTest.cpp')
-rw-r--r-- | tests/PathOpsDRectTest.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/PathOpsDRectTest.cpp b/tests/PathOpsDRectTest.cpp index 70d39d15c0..fa52e780fa 100644 --- a/tests/PathOpsDRectTest.cpp +++ b/tests/PathOpsDRectTest.cpp @@ -11,7 +11,7 @@ #include "SkPathOpsRect.h" #include "Test.h" -static const SkDQuad quadTests[] = { +static const QuadPts quadTests[] = { {{{1, 1}, {2, 1}, {0, 2}}}, {{{0, 0}, {1, 1}, {3, 1}}}, {{{2, 0}, {1, 1}, {2, 2}}}, @@ -19,7 +19,7 @@ static const SkDQuad quadTests[] = { {{{0, 0}, {0, 1}, {1, 1}}}, }; -static const SkDCubic cubicTests[] = { +static const CubicPts cubicTests[] = { {{{2, 0}, {3, 1}, {2, 2}, {1, 1}}}, {{{3, 1}, {2, 2}, {1, 1}, {2, 0}}}, {{{3, 0}, {2, 1}, {3, 2}, {1, 1}}}, @@ -45,7 +45,9 @@ DEF_TEST(PathOpsDRect, reporter) { size_t index; SkDRect rect, rect2; for (index = 0; index < quadTests_count; ++index) { - const SkDQuad& quad = quadTests[index]; + const QuadPts& q = quadTests[index]; + SkDQuad quad; + quad.debugSet(q.fPts); SkASSERT(ValidQuad(quad)); setRawBounds(quad, &rect); rect2.setBounds(quad); @@ -57,7 +59,9 @@ DEF_TEST(PathOpsDRect, reporter) { REPORTER_ASSERT(reporter, rect.contains(rightBottom)); } for (index = 0; index < cubicTests_count; ++index) { - const SkDCubic& cubic = cubicTests[index]; + const CubicPts& c = cubicTests[index]; + SkDCubic cubic; + cubic.debugSet(c.fPts); SkASSERT(ValidCubic(cubic)); setRawBounds(cubic, &rect); rect2.setBounds(cubic); |