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

Side by Side Diff: tests/PathOpsOpTest.cpp

Issue 2310113002: provide safe exit for runaway intersections (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/pathops/SkPathOpsTSect.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "PathOpsExtendedTest.h" 7 #include "PathOpsExtendedTest.h"
8 #include "PathOpsTestCommon.h" 8 #include "PathOpsTestCommon.h"
9 9
10 class PathTest_Private { 10 class PathTest_Private {
(...skipping 7389 matching lines...) Expand 10 before | Expand all | Expand 10 after
7400 path.lineTo(SkBits2Float(0x1f2a312a), SkBits2Float(0xc0032108)); // 3.60396e-20 f, -2.04889f 7400 path.lineTo(SkBits2Float(0x1f2a312a), SkBits2Float(0xc0032108)); // 3.60396e-20 f, -2.04889f
7401 path.close(); 7401 path.close();
7402 path.moveTo(SkBits2Float(0x1f2a312a), SkBits2Float(0xc0032108)); // 3.60396e-20 f, -2.04889f 7402 path.moveTo(SkBits2Float(0x1f2a312a), SkBits2Float(0xc0032108)); // 3.60396e-20 f, -2.04889f
7403 path.quadTo(SkBits2Float(0x3ab38a28), SkBits2Float(0x3ac22c21), SkBits2Float(0x6 c401057), SkBits2Float(0x6d6d6b64)); // 0.00136978f, 0.00148142f, 9.28764e+26f, 4.59236e+27f 7403 path.quadTo(SkBits2Float(0x3ab38a28), SkBits2Float(0x3ac22c21), SkBits2Float(0x6 c401057), SkBits2Float(0x6d6d6b64)); // 0.00136978f, 0.00148142f, 9.28764e+26f, 4.59236e+27f
7404 path.cubicTo(SkBits2Float(0x6d6d6d6d), SkBits2Float(0x6d6d6d6d), SkBits2Float(0x 286d6d6d), SkBits2Float(0x081d2a29), SkBits2Float(0x6d690321), SkBits2Float(0x6b 6b026d)); // 4.59251e+27f, 4.59251e+27f, 1.31799e-14f, 4.7295e-34f, 4.50711e+27 f, 2.84109e+26f 7404 path.cubicTo(SkBits2Float(0x6d6d6d6d), SkBits2Float(0x6d6d6d6d), SkBits2Float(0x 286d6d6d), SkBits2Float(0x081d2a29), SkBits2Float(0x6d690321), SkBits2Float(0x6b 6b026d)); // 4.59251e+27f, 4.59251e+27f, 1.31799e-14f, 4.7295e-34f, 4.50711e+27 f, 2.84109e+26f
7405 7405
7406 SkPath path2(path); 7406 SkPath path2(path);
7407 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 2, filename); 7407 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 2, filename);
7408 } 7408 }
7409 7409
7410 static void fuzz763_31(skiatest::Reporter* reporter, const char* filename) {
7411 SkPath path;
7412 path.setFillType((SkPath::FillType) 1);
7413
7414 SkPath path1(path);
7415 path.reset();
7416 path.setFillType((SkPath::FillType) 0);
7417 path.moveTo(SkBits2Float(0xd72a8c55), SkBits2Float(0x61081f2a)); // -1.8752e+14 f, 1.56938e+20f
7418 path.conicTo(SkBits2Float(0x6a4b7bc0), SkBits2Float(0x4793ed7a), SkBits2Float(0x 282a3a21), SkBits2Float(0xdf3a2128), SkBits2Float(0x471ac575)); // 6.14991e+25f , 75739, 9.4495e-15f, -1.3412e+19f, 39621.5f
7419 path.lineTo(SkBits2Float(0x28404040), SkBits2Float(0x552a298a)); // 1.06721e-14 f, 1.16935e+13f
7420 path.moveTo(SkBits2Float(0x212c685b), SkBits2Float(0x21081f2a)); // 5.8414e-19f , 4.61198e-19f
7421 path.conicTo(SkBits2Float(0x6a4b7bc0), SkBits2Float(0x80ed7a3a), SkBits2Float(0x 2a3a2147), SkBits2Float(0xdf212828), SkBits2Float(0x4f1a3a3a)); // 6.14991e+25f , -2.18089e-38f, 1.65317e-13f, -1.16126e+19f, 2.58751e+09f
7422 path.lineTo(SkBits2Float(0x212c685b), SkBits2Float(0x21081f2a)); // 5.8414e-19f , 4.61198e-19f
7423 path.close();
7424 path.moveTo(SkBits2Float(0x212c685b), SkBits2Float(0x21081f2a)); // 5.8414e-19f , 4.61198e-19f
7425 path.cubicTo(SkBits2Float(0x3ac2213a), SkBits2Float(0x432a2928), SkBits2Float(0x 96812be6), SkBits2Float(0x272a1d2a), SkBits2Float(0x3a2a3529), SkBits2Float(0x3b 1e2ab0)); // 0.00148109f, 170.161f, -2.08688e-25f, 2.3608e-15f, 0.000649291f, 0 .00241343f
7426 path.lineTo(SkBits2Float(0x212c685b), SkBits2Float(0x21081f2a)); // 5.8414e-19f , 4.61198e-19f
7427 path.close();
7428 path.moveTo(SkBits2Float(0x212c685b), SkBits2Float(0x21081f2a)); // 5.8414e-19f , 4.61198e-19f
7429 path.cubicTo(SkBits2Float(0xc5272927), SkBits2Float(0x22383b39), SkBits2Float(0x 1051523a), SkBits2Float(0x2927b029), SkBits2Float(0x685b2d27), SkBits2Float(0x5b 2d6855)); // -2674.57f, 2.4968e-18f, 4.12813e-29f, 3.72342e-14f, 4.14012e+24f, 4.88099e+16f
7430
7431 SkPath path2(path);
7432 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 4, filename);
7433 }
7434
7410 static struct TestDesc failTests[] = { 7435 static struct TestDesc failTests[] = {
7436 TEST(fuzz763_31),
7411 TEST(fuzz763_30), 7437 TEST(fuzz763_30),
7412 TEST(fuzz763_29), 7438 TEST(fuzz763_29),
7413 TEST(fuzz763_28), 7439 TEST(fuzz763_28),
7414 TEST(fuzz763_27), 7440 TEST(fuzz763_27),
7415 TEST(fuzz763_26), 7441 TEST(fuzz763_26),
7416 TEST(fuzz763_25), 7442 TEST(fuzz763_25),
7417 TEST(fuzz763_24), 7443 TEST(fuzz763_24),
7418 TEST(fuzz763_23), 7444 TEST(fuzz763_23),
7419 TEST(fuzz763_22), 7445 TEST(fuzz763_22),
7420 TEST(fuzz763_21), 7446 TEST(fuzz763_21),
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
7471 static struct TestDesc repTests[] = { 7497 static struct TestDesc repTests[] = {
7472 TEST(loops44i), 7498 TEST(loops44i),
7473 TEST(loops45i), 7499 TEST(loops45i),
7474 TEST(loops46i), 7500 TEST(loops46i),
7475 }; 7501 };
7476 7502
7477 DEF_TEST(PathOpsRepOp, reporter) { 7503 DEF_TEST(PathOpsRepOp, reporter) {
7478 for (int index = 0; index < 2; ++index) 7504 for (int index = 0; index < 2; ++index)
7479 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n ullptr, false); 7505 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n ullptr, false);
7480 } 7506 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsTSect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698