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

Side by Side Diff: tests/PathOpsOpTest.cpp

Issue 2327053002: fix fuzzer (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/SkOpCoincidence.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 7509 matching lines...) Expand 10 before | Expand all | Expand 10 after
7520 SkPath path1(path); 7520 SkPath path1(path);
7521 path.reset(); 7521 path.reset();
7522 path.setFillType((SkPath::FillType) 0); 7522 path.setFillType((SkPath::FillType) 0);
7523 path.moveTo(SkBits2Float(0x6c3e3e3e), SkBits2Float(0x586c79ff)); // 9.19959e+26 f, 1.04003e+15f 7523 path.moveTo(SkBits2Float(0x6c3e3e3e), SkBits2Float(0x586c79ff)); // 9.19959e+26 f, 1.04003e+15f
7524 path.quadTo(SkBits2Float(0x6c6c4a6c), SkBits2Float(0x6c6c6c6c), SkBits2Float(0xc 83e6c6c), SkBits2Float(0x3e313e3e)); // 1.14263e+27f, 1.14327e+27f, -194994, 0. 173089f 7524 path.quadTo(SkBits2Float(0x6c6c4a6c), SkBits2Float(0x6c6c6c6c), SkBits2Float(0xc 83e6c6c), SkBits2Float(0x3e313e3e)); // 1.14263e+27f, 1.14327e+27f, -194994, 0. 173089f
7525 7525
7526 SkPath path2(path); 7526 SkPath path2(path);
7527 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 2, filename); 7527 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 2, filename);
7528 } 7528 }
7529 7529
7530 static void fuzz763_36(skiatest::Reporter* reporter, const char* filename) {
7531 SkPath path;
7532 path.setFillType((SkPath::FillType) 0);
7533
7534 SkPath path1(path);
7535 path.reset();
7536 path.setFillType((SkPath::FillType) 0);
7537 path.moveTo(SkBits2Float(0x68556829), SkBits2Float(0x555b2d29)); // 4.03114e+24 f, 1.50617e+13f
7538 path.moveTo(SkBits2Float(0x1f2a312a), SkBits2Float(0xc0032108)); // 3.60396e-20 f, -2.04889f
7539 path.cubicTo(SkBits2Float(0x68392d55), SkBits2Float(0xf05b684b), SkBits2Float(0x 8c55272d), SkBits2Float(0x212a292a), SkBits2Float(0x0321082a), SkBits2Float(0x6a 4b7bc0)); // 3.4979e+24f, -2.71613e+29f, -1.64207e-31f, 5.76527e-19f, 4.7323e-3 7f, 6.14991e+25f
7540 path.conicTo(SkBits2Float(0x212a8ced), SkBits2Float(0x0321081f), SkBits2Float(0x 6a4b7bc0), SkBits2Float(0x2829ed84), SkBits2Float(0x2d555b2d)); // 5.77848e-19f , 4.7323e-37f, 6.14991e+25f, 9.43289e-15f, 1.21279e-11f
7541 path.moveTo(SkBits2Float(0xe8355b2d), SkBits2Float(0xf0682955)); // -3.42572e+2 4f, -2.87402e+29f
7542 path.conicTo(SkBits2Float(0x212a1f5b), SkBits2Float(0x8cef552a), SkBits2Float(0x 295b2d2a), SkBits2Float(0x68210368), SkBits2Float(0x7bc05508)); // 5.76397e-19f , -3.6875e-31f, 4.86669e-14f, 3.04146e+24f, 1.99729e+36f
7543 path.lineTo(SkBits2Float(0xe8355b2d), SkBits2Float(0xf0682955)); // -3.42572e+2 4f, -2.87402e+29f
7544 path.close();
7545 path.moveTo(SkBits2Float(0xe8355b2d), SkBits2Float(0xf0682955)); // -3.42572e+2 4f, -2.87402e+29f
7546 path.lineTo(SkBits2Float(0x5b2c6829), SkBits2Float(0x212a8c55)); // 4.85282e+16 f, 5.7784e-19f
7547 path.conicTo(SkBits2Float(0x212a081f), SkBits2Float(0x4b7bc003), SkBits2Float(0x 5b2d7a6a), SkBits2Float(0xf0556839), SkBits2Float(0x2a8c555b)); // 5.7609e-19f, 1.64987e+07f, 4.88298e+16f, -2.64185e+29f, 2.49282e-13f
7548 path.conicTo(SkBits2Float(0xf42a212a), SkBits2Float(0x4b7bc003), SkBits2Float(0x 2aed7a39), SkBits2Float(0x2108c08c), SkBits2Float(0x7b03211f)); // -5.39162e+31 f, 1.64987e+07f, 4.21845e-13f, 4.63334e-19f, 6.80863e+35f
7549 path.lineTo(SkBits2Float(0xe8355b2d), SkBits2Float(0xf0682955)); // -3.42572e+2 4f, -2.87402e+29f
7550 path.close();
7551 path.moveTo(SkBits2Float(0xe8355b2d), SkBits2Float(0xf0682955)); // -3.42572e+2 4f, -2.87402e+29f
7552 path.lineTo(SkBits2Float(0x6829ed27), SkBits2Float(0x2d555b2d)); // 3.20982e+24 f, 1.21279e-11f
7553 path.moveTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24 f, -2.87614e+29f
7554 path.conicTo(SkBits2Float(0x2a8c555b), SkBits2Float(0x212a1f72), SkBits2Float(0x 03210807), SkBits2Float(0x6a4b7b28), SkBits2Float(0x4793ed7a)); // 2.49282e-13f , 5.76399e-19f, 4.73229e-37f, 6.14984e+25f, 75739
7555 path.lineTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24 f, -2.87614e+29f
7556 path.close();
7557 path.moveTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24 f, -2.87614e+29f
7558 path.quadTo(SkBits2Float(0x282a282a), SkBits2Float(0x8a3adf21), SkBits2Float(0x2 84f1a3a), SkBits2Float(0x213ab38a)); // 9.4456e-15f, -8.99754e-33f, 1.14965e-14 f, 6.32569e-19f
7559 path.lineTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24 f, -2.87614e+29f
7560 path.close();
7561 path.moveTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24 f, -2.87614e+29f
7562 path.quadTo(SkBits2Float(0x1d2a2928), SkBits2Float(0x43962be6), SkBits2Float(0x3 a20002a), SkBits2Float(0x2a8ced29)); // 2.25206e-21f, 300.343f, 0.000610354f, 2 .50336e-13f
7563 path.lineTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24 f, -2.87614e+29f
7564 path.close();
7565 path.moveTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24 f, -2.87614e+29f
7566 path.conicTo(SkBits2Float(0xed210830), SkBits2Float(0xc04b6a03), SkBits2Float(0x 68297b27), SkBits2Float(0x55555b2d), SkBits2Float(0x2ab03a2a)); // -3.11481e+27 f, -3.17835f, 3.20141e+24f, 1.46617e+13f, 3.13042e-13f
7567 path.quadTo(SkBits2Float(0x2720213b), SkBits2Float(0x3a3b2729), SkBits2Float(0xc 4341f20), SkBits2Float(0xecc52a22)); // 2.22225e-15f, 0.000713932f, -720.486f, -1.90686e+27f
7568 path.cubicTo(SkBits2Float(0x5921c25d), SkBits2Float(0x29523a70), SkBits2Float(0x 555b2d68), SkBits2Float(0x1f212a8c), SkBits2Float(0x0321d90a), SkBits2Float(0x5b 2d6829)); // 2.8457e+15f, 4.66801e-14f, 1.50618e+13f, 3.41283e-20f, 4.75628e-37 f, 4.88097e+16f
7569 path.lineTo(SkBits2Float(0x1f2a2a8c), SkBits2Float(0x03210821)); // 3.60341e-20 f, 4.7323e-37f
7570 path.lineTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24 f, -2.87614e+29f
7571 path.close();
7572 path.moveTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24 f, -2.87614e+29f
7573 path.conicTo(SkBits2Float(0x2eed6a7a), SkBits2Float(0x282a3a21), SkBits2Float(0x 3a21df28), SkBits2Float(0x4f1a3a8a), SkBits2Float(0x3ab38a28)); // 1.07964e-10f , 9.4495e-15f, 0.000617492f, 2.58753e+09f, 0.00136978f
7574 path.lineTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24 f, -2.87614e+29f
7575 path.close();
7576 path.moveTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24 f, -2.87614e+29f
7577 path.quadTo(SkBits2Float(0xe61d2a28), SkBits2Float(0x2a43962b), SkBits2Float(0x2 9272a81), SkBits2Float(0x2bb02a55)); // -1.85547e+23f, 1.73716e-13f, 3.71183e-1 4f, 1.25173e-12f
7578 path.quadTo(SkBits2Float(0x2720213b), SkBits2Float(0x3ac52729), SkBits2Float(0xc 4223b32), SkBits2Float(0x6c2a201f)); // 2.22225e-15f, 0.00150416f, -648.925f, 8 .22676e+26f
7579
7580 SkPath path2(path);
7581 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 0, filename);
7582 }
7583
7584 static void fuzz763_35(skiatest::Reporter* reporter, const char* filename) {
7585 SkPath path;
7586 path.setFillType((SkPath::FillType) 1);
7587
7588 SkPath path1(path);
7589 path.reset();
7590 path.setFillType((SkPath::FillType) 0);
7591 path.moveTo(SkBits2Float(0x2aed2a8c), SkBits2Float(0x03210a1f)); // 4.21292e-13 f, 4.73253e-37f
7592 path.conicTo(SkBits2Float(0x0000007b), SkBits2Float(0x7474747f), SkBits2Float(0x 74747474), SkBits2Float(0x747474c4), SkBits2Float(0x74747474)); // 1.7236e-43f, 7.74709e+31f, 7.74708e+31f, 7.74712e+31f, 7.74708e+31f
7593 path.quadTo(SkBits2Float(0x74747474), SkBits2Float(0x74747474), SkBits2Float(0x2 0437474), SkBits2Float(0x43a52b02)); // 7.74708e+31f, 7.74708e+31f, 1.65557e-19 f, 330.336f
7594 path.moveTo(SkBits2Float(0x3a214781), SkBits2Float(0x2128282a)); // 0.000615232 f, 5.69738e-19f
7595 path.lineTo(SkBits2Float(0x4b7bd603), SkBits2Float(0x6cf33b6a)); // 1.65043e+07 f, 2.3524e+27f
7596 path.conicTo(SkBits2Float(0x35778caa), SkBits2Float(0x0000002a), SkBits2Float(0x 74742164), SkBits2Float(0x2a3a7474), SkBits2Float(0x4cc22157)); // 9.22194e-07f , 5.88545e-44f, 7.7368e+31f, 1.65605e-13f, 1.0178e+08f
7597 path.cubicTo(SkBits2Float(0x21479321), SkBits2Float(0x23434cc2), SkBits2Float(0x 3a214793), SkBits2Float(0x2128282a), SkBits2Float(0x323adf81), SkBits2Float(0x77 291a3a)); // 6.76185e-19f, 1.05872e-17f, 0.000615233f, 5.69738e-19f, 1.08774e-0 8f, 3.42981e+33f
7598 path.conicTo(SkBits2Float(0x0000002a), SkBits2Float(0x7474743e), SkBits2Float(0x 74747474), SkBits2Float(0x74746474), SkBits2Float(0x74747474)); // 5.88545e-44f , 7.74706e+31f, 7.74708e+31f, 7.7451e+31f, 7.74708e+31f
7599 path.cubicTo(SkBits2Float(0x21e7fc06), SkBits2Float(0x2a212a59), SkBits2Float(0x 0321081f), SkBits2Float(0x00002a35), SkBits2Float(0x74744000), SkBits2Float(0x29 74e874)); // 1.57199e-18f, 1.43144e-13f, 4.7323e-37f, 1.5141e-41f, 7.74059e+31f , 5.43805e-14f
7600 path.cubicTo(SkBits2Float(0x74647474), SkBits2Float(0x74747474), SkBits2Float(0x 12ec7474), SkBits2Float(0x4cc22147), SkBits2Float(0x47932343), SkBits2Float(0x28 2a3a21)); // 7.24002e+31f, 7.74708e+31f, 1.49224e-27f, 1.0178e+08f, 75334.5f, 9 .4495e-15f
7601 path.lineTo(SkBits2Float(0x3a214781), SkBits2Float(0x2128282a)); // 0.000615232 f, 5.69738e-19f
7602 path.close();
7603 path.moveTo(SkBits2Float(0x3a214781), SkBits2Float(0x2128282a)); // 0.000615232 f, 5.69738e-19f
7604 path.conicTo(SkBits2Float(0x3a323adf), SkBits2Float(0x4977291a), SkBits2Float(0x 0000002a), SkBits2Float(0x7474743e), SkBits2Float(0x74747474)); // 0.000679893f , 1.01237e+06f, 5.88545e-44f, 7.74706e+31f, 7.74708e+31f
7605 path.cubicTo(SkBits2Float(0x74747464), SkBits2Float(0x74747474), SkBits2Float(0x 21e7fc06), SkBits2Float(0x2a212a59), SkBits2Float(0x0321081f), SkBits2Float(0x00 002a35)); // 7.74708e+31f, 7.74708e+31f, 1.57199e-18f, 1.43144e-13f, 4.7323e-37 f, 1.5141e-41f
7606 path.moveTo(SkBits2Float(0x74747440), SkBits2Float(0x742974e8)); // 7.74706e+31 f, 5.3703e+31f
7607 path.cubicTo(SkBits2Float(0x74746474), SkBits2Float(0x74747474), SkBits2Float(0x d912ec74), SkBits2Float(0x553a3728), SkBits2Float(0x29202a8c), SkBits2Float(0x55 55201b)); // 7.7451e+31f, 7.74708e+31f, -2.58471e+15f, 1.27966e+13f, 3.5564e-14 f, 1.46459e+13f
7608 path.moveTo(SkBits2Float(0x31292768), SkBits2Float(0x212d2aff)); // 2.46151e-09 f, 5.86716e-19f
7609 path.quadTo(SkBits2Float(0x2128282a), SkBits2Float(0x323adf81), SkBits2Float(0x7 7291a3a), SkBits2Float(0x00002a49)); // 5.69738e-19f, 1.08774e-08f, 3.42981e+33 f, 1.51691e-41f
7610 path.moveTo(SkBits2Float(0x7474743e), SkBits2Float(0x74747474)); // 7.74706e+31 f, 7.74708e+31f
7611 path.cubicTo(SkBits2Float(0x74747464), SkBits2Float(0x74747474), SkBits2Float(0x 21e7fc06), SkBits2Float(0x2a212a59), SkBits2Float(0x0321081f), SkBits2Float(0x00 002a35)); // 7.74708e+31f, 7.74708e+31f, 1.57199e-18f, 1.43144e-13f, 4.7323e-37 f, 1.5141e-41f
7612 path.moveTo(SkBits2Float(0x74747440), SkBits2Float(0x74747474)); // 7.74706e+31 f, 7.74708e+31f
7613 path.cubicTo(SkBits2Float(0x74747464), SkBits2Float(0x74747474), SkBits2Float(0x 43747474), SkBits2Float(0xa52b0220), SkBits2Float(0x47812a43), SkBits2Float(0x28 2a3a21)); // 7.74708e+31f, 7.74708e+31f, 244.455f, -1.48326e-16f, 66132.5f, 9.4 495e-15f
7614 path.lineTo(SkBits2Float(0x74747440), SkBits2Float(0x74747474)); // 7.74706e+31 f, 7.74708e+31f
7615 path.close();
7616 path.moveTo(SkBits2Float(0x74747440), SkBits2Float(0x74747474)); // 7.74706e+31 f, 7.74708e+31f
7617 path.conicTo(SkBits2Float(0x3a323adf), SkBits2Float(0x19433b1a), SkBits2Float(0x 5921e7fc), SkBits2Float(0x1f2a212a), SkBits2Float(0x35032108)); // 0.000679893f , 1.00932e-23f, 2.84828e+15f, 3.60263e-20f, 4.88494e-07f
7618
7619 SkPath path2(path);
7620 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 4, filename);
7621 }
7622
7530 static struct TestDesc failTests[] = { 7623 static struct TestDesc failTests[] = {
7624 TEST(fuzz763_36),
7625 TEST(fuzz763_35),
7531 TEST(fuzz763_34), 7626 TEST(fuzz763_34),
7532 TEST(fuzz763_33), 7627 TEST(fuzz763_33),
7533 TEST(fuzz763_32), 7628 TEST(fuzz763_32),
7534 TEST(fuzz763_31), 7629 TEST(fuzz763_31),
7535 TEST(fuzz763_30), 7630 TEST(fuzz763_30),
7536 TEST(fuzz763_29), 7631 TEST(fuzz763_29),
7537 TEST(fuzz763_28), 7632 TEST(fuzz763_28),
7538 TEST(fuzz763_27), 7633 TEST(fuzz763_27),
7539 TEST(fuzz763_26), 7634 TEST(fuzz763_26),
7540 TEST(fuzz763_25), 7635 TEST(fuzz763_25),
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
7595 static struct TestDesc repTests[] = { 7690 static struct TestDesc repTests[] = {
7596 TEST(loops44i), 7691 TEST(loops44i),
7597 TEST(loops45i), 7692 TEST(loops45i),
7598 TEST(loops46i), 7693 TEST(loops46i),
7599 }; 7694 };
7600 7695
7601 DEF_TEST(PathOpsRepOp, reporter) { 7696 DEF_TEST(PathOpsRepOp, reporter) {
7602 for (int index = 0; index < 2; ++index) 7697 for (int index = 0; index < 2; ++index)
7603 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n ullptr, false); 7698 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n ullptr, false);
7604 } 7699 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpCoincidence.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698