Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Unified Diff: tests/PathOpsCubicLineIntersectionIdeas.cpp

Issue 2426173002: fix fuzzers (Closed)
Patch Set: fix dm Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/PathOpsCubicIntersectionTestData.cpp ('k') | tests/PathOpsCubicLineIntersectionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsCubicLineIntersectionIdeas.cpp
diff --git a/tests/PathOpsCubicLineIntersectionIdeas.cpp b/tests/PathOpsCubicLineIntersectionIdeas.cpp
index b23dd0ceaf6b57058a6def5e2cd317a46a0c3049..15554751da45d15cabd4110b4d0986efb2a8034a 100644
--- a/tests/PathOpsCubicLineIntersectionIdeas.cpp
+++ b/tests/PathOpsCubicLineIntersectionIdeas.cpp
@@ -16,7 +16,7 @@
static bool gPathOpsCubicLineIntersectionIdeasVerbose = false;
static struct CubicLineFailures {
- SkDCubic c;
+ CubicPts c;
double t;
SkDPoint p;
} cubicLineFailures[] = {
@@ -145,13 +145,15 @@ DEF_TEST(PathOpsCubicLineRoots, reporter) {
double largestR2 = 0;
for (int index = 0; index < 1000000000; ++index) {
SkDPoint origin = {ran.nextRangeF(-1000, 1000), ran.nextRangeF(-1000, 1000)};
- SkDCubic cubic = {{origin,
+ CubicPts cuPts = {{origin,
{ran.nextRangeF(-1000, 1000), ran.nextRangeF(-1000, 1000)},
{ran.nextRangeF(-1000, 1000), ran.nextRangeF(-1000, 1000)},
{ran.nextRangeF(-1000, 1000), ran.nextRangeF(-1000, 1000)}
}};
// construct a line at a known intersection
double t = ran.nextRangeF(0, 1);
+ SkDCubic cubic;
+ cubic.debugSet(cuPts.fPts);
SkDPoint pt = cubic.ptAtT(t);
// skip answers with no intersections (although note the bug!) or two, or more
// see if the line / cubic has a fun range of roots
@@ -248,7 +250,9 @@ DEF_TEST(PathOpsCubicLineRoots, reporter) {
}
static double testOneFailure(const CubicLineFailures& failure) {
- const SkDCubic& cubic = failure.c;
+ const CubicPts& c = failure.c;
+ SkDCubic cubic;
+ cubic.debugSet(c.fPts);
const SkDPoint& pt = failure.p;
double A, B, C, D;
SkDCubic::Coefficients(&cubic[0].fY, &A, &B, &C, &D);
« no previous file with comments | « tests/PathOpsCubicIntersectionTestData.cpp ('k') | tests/PathOpsCubicLineIntersectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698