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

Side by Side Diff: tests/PathOpsOpTest.cpp

Issue 2166543002: fix fuzzer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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/SkOpSpan.cpp ('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 6401 matching lines...) Expand 10 before | Expand all | Expand 10 after
6412 path.setFillType((SkPath::FillType) 0); 6412 path.setFillType((SkPath::FillType) 0);
6413 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0 6413 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
6414 path.cubicTo(SkBits2Float(0x1931204a), SkBits2Float(0x2ba1a14a), SkBits2Float(0x 4a4a08ff), SkBits2Float(0x4a4a08ff), SkBits2Float(0x4a4a4a34), SkBits2Float(0x4a 4a4a4a)); // 9.15721e-24f, 1.14845e-12f, 3.31014e+06f, 3.31014e+06f, 3.31432e+0 6f, 3.31432e+06f 6414 path.cubicTo(SkBits2Float(0x1931204a), SkBits2Float(0x2ba1a14a), SkBits2Float(0x 4a4a08ff), SkBits2Float(0x4a4a08ff), SkBits2Float(0x4a4a4a34), SkBits2Float(0x4a 4a4a4a)); // 9.15721e-24f, 1.14845e-12f, 3.31014e+06f, 3.31014e+06f, 3.31432e+0 6f, 3.31432e+06f
6415 path.moveTo(SkBits2Float(0x000010a1), SkBits2Float(0x19312000)); // 5.96533e-42 f, 9.15715e-24f 6415 path.moveTo(SkBits2Float(0x000010a1), SkBits2Float(0x19312000)); // 5.96533e-42 f, 9.15715e-24f
6416 path.cubicTo(SkBits2Float(0x4a4a4a4a), SkBits2Float(0x4a4a4a4a), SkBits2Float(0x a14a4a4a), SkBits2Float(0x08ff2ba1), SkBits2Float(0x08ff4a4a), SkBits2Float(0x4a 344a4a)); // 3.31432e+06f, 3.31432e+06f, -6.85386e-19f, 1.53575e-33f, 1.53647e- 33f, 2.95387e+06f 6416 path.cubicTo(SkBits2Float(0x4a4a4a4a), SkBits2Float(0x4a4a4a4a), SkBits2Float(0x a14a4a4a), SkBits2Float(0x08ff2ba1), SkBits2Float(0x08ff4a4a), SkBits2Float(0x4a 344a4a)); // 3.31432e+06f, 3.31432e+06f, -6.85386e-19f, 1.53575e-33f, 1.53647e- 33f, 2.95387e+06f
6417 path.cubicTo(SkBits2Float(0x544a4a4a), SkBits2Float(0x4a4a4a4a), SkBits2Float(0x 2ba1a14a), SkBits2Float(0x4e4a08ff), SkBits2Float(0x4a4a4a4a), SkBits2Float(0xa1 a181ff)); // 3.47532e+12f, 3.31432e+06f, 1.14845e-12f, 8.47397e+08f, 3.31432e+0 6f, -1.09442e-18f 6417 path.cubicTo(SkBits2Float(0x544a4a4a), SkBits2Float(0x4a4a4a4a), SkBits2Float(0x 2ba1a14a), SkBits2Float(0x4e4a08ff), SkBits2Float(0x4a4a4a4a), SkBits2Float(0xa1 a181ff)); // 3.47532e+12f, 3.31432e+06f, 1.14845e-12f, 8.47397e+08f, 3.31432e+0 6f, -1.09442e-18f
6418 SkPath path2(path); 6418 SkPath path2(path);
6419 testPathOpCheck(reporter, path1, path2, kReverseDifference_SkPathOp, filenam e, true); 6419 testPathOpCheck(reporter, path1, path2, kReverseDifference_SkPathOp, filenam e, true);
6420 } 6420 }
6421 6421
6422 static void fuzz763_6(skiatest::Reporter* reporter, const char* filename) {
6423 SkPath path;
6424 path.setFillType((SkPath::FillType) 1);
6425 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x6a2a291f)); // 0, 5.14279e +25f
6426 path.cubicTo(SkBits2Float(0x68295b2d), SkBits2Float(0x00000000), SkBits2Float(0x 00000000), SkBits2Float(0x00000000), SkBits2Float(0x00000000), SkBits2Float(0x68 556829)); // 3.19905e+24f, 0, 0, 0, 0, 4.03114e+24f
6427 path.lineTo(SkBits2Float(0x00000000), SkBits2Float(0x68555b2a)); // 0, 4.03018e +24f
6428 path.cubicTo(SkBits2Float(0x00000000), SkBits2Float(0x67d55b2a), SkBits2Float(0x 67296a4b), SkBits2Float(0x67555b2a), SkBits2Float(0x677e1f70), SkBits2Float(0x66 d55b2a)); // 0, 2.01509e+24f, 8.00041e+23f, 1.00755e+24f, 1.20006e+24f, 5.03773 e+23f
6429 path.cubicTo(SkBits2Float(0x678f0684), SkBits2Float(0x6684f008), SkBits2Float(0x 6798f8ea), SkBits2Float(0x6625a942), SkBits2Float(0x67961914), SkBits2Float(0x65 ce709a)); // 1.35084e+24f, 3.1389e+23f, 1.44478e+24f, 1.95578e+23f, 1.41764e+24 f, 1.21861e+23f
6430 path.cubicTo(SkBits2Float(0x679174f7), SkBits2Float(0x63199132), SkBits2Float(0x 6756c79f), SkBits2Float(0x606478de), SkBits2Float(0x65682bcf), SkBits2Float(0x00 000000)); // 1.3738e+24f, 2.83281e+21f, 1.01427e+24f, 6.58526e+19f, 6.85248e+22 f, 0
6431 path.conicTo(SkBits2Float(0x68295b02), SkBits2Float(0x60f7f28b), SkBits2Float(0x 00000000), SkBits2Float(0x6a2a291f), SkBits2Float(0x42784f5a)); // 3.19903e+24f , 1.42932e+20f, 0, 5.14279e+25f, 62.0775f
6432 path.close();
6433 path.moveTo(SkBits2Float(0x654d6d10), SkBits2Float(0x00000000)); // 6.06311e+22 f, 0
6434 path.lineTo(SkBits2Float(0x6a4b7bc0), SkBits2Float(0x00000000)); // 6.14991e+25 f, 0
6435 path.lineTo(SkBits2Float(0x00000000), SkBits2Float(0x6a4b7bc0)); // 0, 6.14991e +25f
6436 path.lineTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
6437
6438 SkPath path1(path);
6439 path.reset();
6440 path.setFillType((SkPath::FillType) 0);
6441 path.moveTo(SkBits2Float(0x3ac23a55), SkBits2Float(0x2a292827)); // 0.00148184f , 1.50241e-13f
6442 path.lineTo(SkBits2Float(0x63962be6), SkBits2Float(0x272a812a)); // 5.54035e+21 f, 2.36623e-15f
6443
6444 SkPath path2(path);
6445 testPathOpFail(reporter, path1, path2, (SkPathOp) 0, filename);
6446 }
6447
6422 static struct TestDesc failTests[] = { 6448 static struct TestDesc failTests[] = {
6449 TEST(fuzz763_6),
6423 TEST(fuzz763_2c), 6450 TEST(fuzz763_2c),
6424 TEST(fuzz763_2b), 6451 TEST(fuzz763_2b),
6425 TEST(fuzz763_2a), 6452 TEST(fuzz763_2a),
6426 TEST(fuzz763_5a), 6453 TEST(fuzz763_5a),
6427 TEST(fuzz763_3a), 6454 TEST(fuzz763_3a),
6428 TEST(fuzz763_1a), 6455 TEST(fuzz763_1a),
6429 TEST(fuzz763_1b), 6456 TEST(fuzz763_1b),
6430 TEST(fuzz763_1c), 6457 TEST(fuzz763_1c),
6431 TEST(fuzz763_2), 6458 TEST(fuzz763_2),
6432 TEST(fuzz763_5), 6459 TEST(fuzz763_5),
(...skipping 26 matching lines...) Expand all
6459 static struct TestDesc repTests[] = { 6486 static struct TestDesc repTests[] = {
6460 TEST(loops44i), 6487 TEST(loops44i),
6461 TEST(loops45i), 6488 TEST(loops45i),
6462 TEST(loops46i), 6489 TEST(loops46i),
6463 }; 6490 };
6464 6491
6465 DEF_TEST(PathOpsRepOp, reporter) { 6492 DEF_TEST(PathOpsRepOp, reporter) {
6466 for (int index = 0; index < 2; ++index) 6493 for (int index = 0; index < 2; ++index)
6467 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n ullptr, false); 6494 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n ullptr, false);
6468 } 6495 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpSpan.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698