diff options
author | Cary Clark <caryclark@skia.org> | 2018-03-09 07:38:47 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-09 14:54:30 +0000 |
commit | 74b429086122e19e82fe090fc999120ed48d3532 (patch) | |
tree | 0e9ee4be41ba35dafbd82c42ac7d40213de81250 /tests | |
parent | b537879c7214efd87840c9a7267ab3b3facda873 (diff) |
some fuzzer fixes
should fix three or four of the PathOp asserts
triggered by the fuzzer tool.
R=kjlubick@google.com
Bug: skia:
Change-Id: I470895addf1e922da6a7c41d44d54eca92e68fb6
Reviewed-on: https://skia-review.googlesource.com/113163
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PathOpsConicQuadIntersectionTest.cpp | 9 | ||||
-rw-r--r-- | tests/PathOpsCubicConicIntersectionTest.cpp | 16 | ||||
-rw-r--r-- | tests/PathOpsSimplifyFailTest.cpp | 14 |
3 files changed, 37 insertions, 2 deletions
diff --git a/tests/PathOpsConicQuadIntersectionTest.cpp b/tests/PathOpsConicQuadIntersectionTest.cpp index 99411dc98c..bdf1d42d37 100644 --- a/tests/PathOpsConicQuadIntersectionTest.cpp +++ b/tests/PathOpsConicQuadIntersectionTest.cpp @@ -15,6 +15,13 @@ static struct conicQuad { ConicPts conic; QuadPts quad; } conicQuadTests[] = { + {{{{{0.00000000000000000, -1.8135968446731567 },
+ {0.00000000000000000, -1.0033817291259766 },
+ {-0.0073835160583257675, 0.00000000000000000 }}}, 2.26585215e+11f},
+ {{{0.00000000000000000, -1.0000113248825073 },
+ {-2.4824290449032560e-05, -1.0000115633010864 },
+ {-0.0073835160583257675, 0.00000000000000000 }}}}, + {{{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842f}, {{{494.30481,224.474213}, {494.334961,224.538284}, {494.355774,224.605927}}}}, @@ -69,5 +76,5 @@ DEF_TEST(PathOpsConicQuadIntersection, reporter) { } DEF_TEST(PathOpsConicQuadIntersectionOneOff, reporter) { - conicQuadIntersection(reporter, 1); + conicQuadIntersection(reporter, 0); } diff --git a/tests/PathOpsCubicConicIntersectionTest.cpp b/tests/PathOpsCubicConicIntersectionTest.cpp index d7924634b2..ff4dec9864 100644 --- a/tests/PathOpsCubicConicIntersectionTest.cpp +++ b/tests/PathOpsCubicConicIntersectionTest.cpp @@ -15,6 +15,20 @@ static struct cubicConic { CubicPts cubic; ConicPts conic; } cubicConicTests[] = { +#if 0 +// FIXME: this triggers an assert in bool SkTSect::extractCoincident() at +// SkOPASSERT(oppStartT < oppEndT); +// Throwing an error here breaks one test, but only in release. +// More work to be done to figure this out. + {{{{2.1883804947719909e-05, 3.6366123822517693e-05 },
+ {2.9145950975362211e-05, 2.9117207304807380e-05 },
+ {2.9113532946212217e-05, 2.9173743314458989e-05 },
+ {0.00000000000000000, 5.8282588724978268e-05 }}},
+ {{{{0.00000000000000000, 5.8282581449020654e-05 },
+ {0.00000000000000000, 5.8282563259126619e-05 },
+ {5.8282588724978268e-05, 0.00000000000000000 }}}, 53684.6563f}}, +#endif
+ {{{{188.60000610351562, 2041.5999755859375}, {188.60000610351562, 2065.39990234375}, {208, 2084.800048828125}, {231.80000305175781, 2084.800048828125}}}, {{{{231.80000305175781, 2084.800048828125}, {188.60000610351562, 2084.800048828125}, @@ -73,5 +87,5 @@ DEF_TEST(PathOpsCubicConicIntersection, reporter) { } DEF_TEST(PathOpsCubicConicIntersectionOneOff, reporter) { - cubicConicIntersection(reporter, 1); + cubicConicIntersection(reporter, 0); } diff --git a/tests/PathOpsSimplifyFailTest.cpp b/tests/PathOpsSimplifyFailTest.cpp index b6f210e8ea..58179a2175 100644 --- a/tests/PathOpsSimplifyFailTest.cpp +++ b/tests/PathOpsSimplifyFailTest.cpp @@ -215,9 +215,23 @@ path.close(); testSimplifyFuzz(reporter, path, filename); } +static void fuzz_x3(skiatest::Reporter* reporter, const char* filename) { + SkPath path; +path.setFillType(SkPath::kWinding_FillType);
+path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
+path.cubicTo(SkBits2Float(0x92743420), SkBits2Float(0x74747474), SkBits2Float(0x0f747c74), SkBits2Float(0xff538565), SkBits2Float(0x74744374), SkBits2Float(0x20437474)); // -7.70571e-28f, 7.74708e+31f, 1.20541e-29f, -2.8116e+38f, 7.74102e+31f, 1.65557e-19f
+path.conicTo(SkBits2Float(0x7474926d), SkBits2Float(0x7c747474), SkBits2Float(0x00170f74), SkBits2Float(0x3a7410d7), SkBits2Float(0x3a3a3a3a)); // 7.7508e+31f, 5.07713e+36f, 2.11776e-39f, 0.000931037f, 0.000710401f
+path.quadTo(SkBits2Float(0x203a3a3a), SkBits2Float(0x7459f43a), SkBits2Float(0x74747474), SkBits2Float(0x2043ad6e)); // 1.57741e-19f, 6.90724e+31f, 7.74708e+31f, 1.65745e-19f
+path.conicTo(SkBits2Float(0x7474b374), SkBits2Float(0x74747474), SkBits2Float(0x0f747c74), SkBits2Float(0xff537065), SkBits2Float(0x74744374)); // 7.75488e+31f, 7.74708e+31f, 1.20541e-29f, -2.81051e+38f, 7.74102e+31f
+path.cubicTo(SkBits2Float(0x3a3a3a3a), SkBits2Float(0x3a2c103a), SkBits2Float(0x7474263a), SkBits2Float(0x74976507), SkBits2Float(0x000000ff), SkBits2Float(0x00000000)); // 0.000710401f, 0.00065637f, 7.7374e+31f, 9.59578e+31f, 3.57331e-43f, 0
+ testSimplifyFuzz(reporter, path, filename); +} + + #define TEST(test) test(reporter, #test) DEF_TEST(PathOpsSimplifyFail, reporter) { + TEST(fuzz_x3); TEST(fuzz763_2); TEST(fuzz763_1); TEST(fuzz_x2); |