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

Side by Side Diff: tests/PathOpsOpTest.cpp

Issue 2358043002: fix skia pathops fuzzers (Closed)
Patch Set: 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 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 7719 matching lines...) Expand 10 before | Expand all | Expand 10 after
7730 7730
7731 SkPath path1(path); 7731 SkPath path1(path);
7732 path.reset(); 7732 path.reset();
7733 path.setFillType((SkPath::FillType) 0); 7733 path.setFillType((SkPath::FillType) 0);
7734 path.moveTo(SkBits2Float(0x52528c55), SkBits2Float(0x29215252)); // 2.26074e+11 f, 3.58206e-14f 7734 path.moveTo(SkBits2Float(0x52528c55), SkBits2Float(0x29215252)); // 2.26074e+11 f, 3.58206e-14f
7735 7735
7736 SkPath path2(path); 7736 SkPath path2(path);
7737 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 0, filename); 7737 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 0, filename);
7738 } 7738 }
7739 7739
7740 static void fuzz763_41(skiatest::Reporter* reporter, const char* filename) {
7741 SkPath path;
7742 path.setFillType((SkPath::FillType) 0);
7743
7744 SkPath path1(path);
7745 path.reset();
7746 path.setFillType((SkPath::FillType) 0);
7747 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
7748 path.quadTo(SkBits2Float(0x7a057c72), SkBits2Float(0x72727272), SkBits2Float(0x7 25b5e72), SkBits2Float(0x055f0089)); // 1.73275e+35f, 4.80216e+30f, 4.34505e+30 f, 1.04855e-35f
7749 path.quadTo(SkBits2Float(0x00057272), SkBits2Float(0x72ff0000), SkBits2Float(0xb a405e72), SkBits2Float(0x031b0074)); // 5.00233e-40f, 1.01016e+31f, -0.00073382 9f, 4.55509e-37f
7750 path.lineTo(SkBits2Float(0x664af700), SkBits2Float(0x56397d39)); // 2.39619e+23 f, 5.09869e+13f
7751 path.quadTo(SkBits2Float(0x7a057273), SkBits2Float(0x057300e4), SkBits2Float(0x2 57c0c9f), SkBits2Float(0x72400006)); // 1.73224e+35f, 1.1426e-35f, 2.18618e-16f , 3.80295e+30f
7752 path.quadTo(SkBits2Float(0xba5b5e72), SkBits2Float(0x030000ff), SkBits2Float(0x7 4ba00e8), SkBits2Float(0xe8ec4000)); // -0.000836826f, 3.7617e-37f, 1.17894e+32 f, -8.92527e+24f
7753 path.moveTo(SkBits2Float(0x39724aff), SkBits2Float(0x7200397d)); // 0.000231069 f, 2.53975e+30f
7754 path.quadTo(SkBits2Float(0x827a0572), SkBits2Float(0x08727272), SkBits2Float(0x0 8080808), SkBits2Float(0x08080808)); // -1.83687e-37f, 7.29588e-34f, 4.09355e-3 4f, 4.09355e-34f
7755 path.lineTo(SkBits2Float(0x08080808), SkBits2Float(0x08080808)); // 4.09355e-34 f, 4.09355e-34f
7756 path.lineTo(SkBits2Float(0x08080808), SkBits2Float(0x08080808)); // 4.09355e-34 f, 4.09355e-34f
7757 path.conicTo(SkBits2Float(0x72728c08), SkBits2Float(0x5b5e7272), SkBits2Float(0x 000074ba), SkBits2Float(0x03f8e300), SkBits2Float(0x5aff00e8)); // 4.80414e+30f , 6.26133e+16f, 4.18736e-41f, 1.46282e-36f, 3.58886e+16f
7758 path.quadTo(SkBits2Float(0x00800039), SkBits2Float(0x72100039), SkBits2Float(0x7 27a0572), SkBits2Float(0x7a727272)); // 1.1755e-38f, 2.85223e+30f, 4.95218e+30f , 3.14714e+35f
7759 path.lineTo(SkBits2Float(0x7272727a), SkBits2Float(0xdb5e6472)); // 4.80216e+30 f, -6.25979e+16f
7760 path.moveTo(SkBits2Float(0x440039fc), SkBits2Float(0x0000f647)); // 512.906f, 8 .83477e-41f
7761 path.lineTo(SkBits2Float(0x666d0100), SkBits2Float(0x726efe62)); // 2.79805e+23 f, 4.73376e+30f
7762 path.lineTo(SkBits2Float(0x440039fc), SkBits2Float(0x0000f647)); // 512.906f, 8 .83477e-41f
7763 path.close();
7764 path.moveTo(SkBits2Float(0x440039fc), SkBits2Float(0x0000f647)); // 512.906f, 8 .83477e-41f
7765 path.conicTo(SkBits2Float(0x72727272), SkBits2Float(0xf3db5e64), SkBits2Float(0x 475afc16), SkBits2Float(0x170100ad), SkBits2Float(0x01008000)); // 4.80216e+30f , -3.47604e+31f, 56060.1f, 4.1683e-25f, 2.36017e-38f
7766 path.quadTo(SkBits2Float(0x72057272), SkBits2Float(0x8c7a3472), SkBits2Float(0x7 2727272), SkBits2Float(0x00f6475e)); // 2.64319e+30f, -1.92751e-31f, 4.80216e+3 0f, 2.26171e-38f
7767 path.moveTo(SkBits2Float(0x6d106d43), SkBits2Float(0x6efe6266)); // 2.79362e+27 f, 3.93641e+28f
7768 path.quadTo(SkBits2Float(0x72727a05), SkBits2Float(0xba5b7272), SkBits2Float(0x0 3000074), SkBits2Float(0x5aff00e8)); // 4.80274e+30f, -0.000837124f, 3.76163e-3 7f, 3.58886e+16f
7769 path.quadTo(SkBits2Float(0x00da0039), SkBits2Float(0x72100039), SkBits2Float(0x7 27a0572), SkBits2Float(0x7a727272)); // 2.00202e-38f, 2.85223e+30f, 4.95218e+30 f, 3.14714e+35f
7770 path.lineTo(SkBits2Float(0x7272727a), SkBits2Float(0xdb5e6472)); // 4.80216e+30 f, -6.25979e+16f
7771 path.lineTo(SkBits2Float(0xfc5b97fc), SkBits2Float(0x47440039)); // -4.56078e+3 6f, 50176.2f
7772 path.lineTo(SkBits2Float(0x00710000), SkBits2Float(0x62766d01)); // 1.03774e-38 f, 1.13644e+21f
7773 path.quadTo(SkBits2Float(0x7a05726e), SkBits2Float(0x72727272), SkBits2Float(0xf 3db5e64), SkBits2Float(0x4a5afc16)); // 1.73224e+35f, 4.80216e+30f, -3.47604e+3 1f, 3.58785e+06f
7774
7775 SkPath path2(path);
7776 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 4, filename);
7777 }
7778
7779 static void fuzz763_40(skiatest::Reporter* reporter, const char* filename) {
7780 SkPath path;
7781 path.setFillType((SkPath::FillType) 1);
7782
7783 SkPath path1(path);
7784 path.reset();
7785 path.setFillType((SkPath::FillType) 0);
7786 path.moveTo(SkBits2Float(0x10190004), SkBits2Float(0x7272727a)); // 3.01739e-29 f, 4.80216e+30f
7787 path.quadTo(SkBits2Float(0xf3db5e64), SkBits2Float(0x5b97fc16), SkBits2Float(0x0 00039fc), SkBits2Float(0x01008000)); // -3.47604e+31f, 8.55598e+16f, 2.08009e-4 1f, 2.36017e-38f
7788 path.quadTo(SkBits2Float(0x7a057272), SkBits2Float(0x72727272), SkBits2Float(0x7 25b5e72), SkBits2Float(0x41720089)); // 1.73224e+35f, 4.80216e+30f, 4.34505e+30 f, 15.1251f
7789 path.lineTo(SkBits2Float(0x63636363), SkBits2Float(0x63606363)); // 4.19457e+21 f, 4.13923e+21f
7790 path.lineTo(SkBits2Float(0x01000000), SkBits2Float(0x10010004)); // 2.35099e-38 f, 2.54408e-29f
7791 path.conicTo(SkBits2Float(0x72727272), SkBits2Float(0xf3db5e64), SkBits2Float(0x 4a5afc16), SkBits2Float(0x0000d07d), SkBits2Float(0x01008000)); // 4.80216e+30f , -3.47604e+31f, 3.58785e+06f, 7.47915e-41f, 2.36017e-38f
7792 path.quadTo(SkBits2Float(0x7a057272), SkBits2Float(0x72727272), SkBits2Float(0x7 25b5e72), SkBits2Float(0x63720089)); // 1.73224e+35f, 4.80216e+30f, 4.34505e+30 f, 4.46415e+21f
7793 path.lineTo(SkBits2Float(0x63636363), SkBits2Float(0x63606363)); // 4.19457e+21 f, 4.13923e+21f
7794 path.lineTo(SkBits2Float(0x72000000), SkBits2Float(0x5b5e72b4)); // 2.5353e+30f , 6.26136e+16f
7795 path.quadTo(SkBits2Float(0x05720089), SkBits2Float(0x05727272), SkBits2Float(0x7 272727a), SkBits2Float(0x5b5e7272)); // 1.13789e-35f, 1.13998e-35f, 4.80216e+30 f, 6.26133e+16f
7796 path.cubicTo(SkBits2Float(0x03000074), SkBits2Float(0x4aff00e8), SkBits2Float(0x 397d3972), SkBits2Float(0x01727200), SkBits2Float(0x72727a00), SkBits2Float(0x5e 8d7272)); // 3.76163e-37f, 8.35596e+06f, 0.000241494f, 4.45302e-38f, 4.80274e+3 0f, 5.09617e+18f
7797 path.moveTo(SkBits2Float(0x72008972), SkBits2Float(0x458fe705)); // 2.54594e+30 f, 4604.88f
7798 path.quadTo(SkBits2Float(0x7a057272), SkBits2Float(0xe8727272), SkBits2Float(0xb a5b5e03), SkBits2Float(0x03000074)); // 1.73224e+35f, -4.5797e+24f, -0.00083682 f, 3.76163e-37f
7799 path.lineTo(SkBits2Float(0xf3dbff00), SkBits2Float(0x00397d16)); // -3.48598e+3 1f, 5.2795e-39f
7800 path.cubicTo(SkBits2Float(0x7a101900), SkBits2Float(0x72727272), SkBits2Float(0x f3db5e64), SkBits2Float(0x0197fc16), SkBits2Float(0x200c2010), SkBits2Float(0x20 203620)); // 1.87049e+35f, 4.80216e+30f, -3.47604e+31f, 5.58304e-38f, 1.18691e- 19f, 1.35704e-19f
7801
7802 SkPath path2(path);
7803 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 2, filename);
7804 }
7805
7806 static void fuzz763_39(skiatest::Reporter* reporter, const char* filename) {
7807 SkPath path;
7808 path.setFillType((SkPath::FillType) 0);
7809
7810 SkPath path1(path);
7811 path.reset();
7812 path.setFillType((SkPath::FillType) 0);
7813 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
7814 path.quadTo(SkBits2Float(0x7a057c72), SkBits2Float(0x72727272), SkBits2Float(0x7 25b5e72), SkBits2Float(0x055f0089)); // 1.73275e+35f, 4.80216e+30f, 4.34505e+30 f, 1.04855e-35f
7815 path.quadTo(SkBits2Float(0x7a057272), SkBits2Float(0x72727272), SkBits2Float(0xb a405e72), SkBits2Float(0x03000074)); // 1.73224e+35f, 4.80216e+30f, -0.00073382 9f, 3.76163e-37f
7816 path.lineTo(SkBits2Float(0x664aff00), SkBits2Float(0x56397d39)); // 2.39655e+23 f, 5.09869e+13f
7817 path.quadTo(SkBits2Float(0x7a057273), SkBits2Float(0x057300ff), SkBits2Float(0x2 57c0c9f), SkBits2Float(0x72787257)); // 1.73224e+35f, 1.1426e-35f, 2.18618e-16f , 4.92099e+30f
7818 path.quadTo(SkBits2Float(0xba5b5e72), SkBits2Float(0x03000093), SkBits2Float(0x7 4ba00e8), SkBits2Float(0xe8ecff00)); // -0.000836826f, 3.76165e-37f, 1.17894e+3 2f, -8.95346e+24f
7819 path.moveTo(SkBits2Float(0x39724aff), SkBits2Float(0x7200397d)); // 0.000231069 f, 2.53975e+30f
7820 path.quadTo(SkBits2Float(0x827a0572), SkBits2Float(0x72727272), SkBits2Float(0x7 24adf00), SkBits2Float(0x00397d39)); // -1.83687e-37f, 4.80216e+30f, 4.01828e+3 0f, 5.27954e-39f
7821 path.quadTo(SkBits2Float(0x7a057272), SkBits2Float(0x16f3abab), SkBits2Float(0xf c5b97fc), SkBits2Float(0x47440039)); // 1.73224e+35f, 3.93671e-25f, -4.56078e+3 6f, 50176.2f
7822 path.lineTo(SkBits2Float(0x00710000), SkBits2Float(0x62767201)); // 1.03774e-38 f, 1.13653e+21f
7823 path.quadTo(SkBits2Float(0x7a05726e), SkBits2Float(0x72727272), SkBits2Float(0xf 3db5e64), SkBits2Float(0x4a5afc16)); // 1.73224e+35f, 4.80216e+30f, -3.47604e+3 1f, 3.58785e+06f
7824
7825 SkPath path2(path);
7826 testPathOpFuzz(reporter, path1, path2, (SkPathOp) 4, filename);
7827 }
7828
7740 static struct TestDesc failTests[] = { 7829 static struct TestDesc failTests[] = {
7830 TEST(fuzz763_41),
7831 TEST(fuzz763_40),
7832 TEST(fuzz763_39),
7741 TEST(fuzz763_38), 7833 TEST(fuzz763_38),
7742 TEST(fuzz763_37), 7834 TEST(fuzz763_37),
7743 TEST(fuzz763_36), 7835 TEST(fuzz763_36),
7744 TEST(fuzz763_35), 7836 TEST(fuzz763_35),
7745 TEST(fuzz763_34), 7837 TEST(fuzz763_34),
7746 TEST(fuzz763_33), 7838 TEST(fuzz763_33),
7747 TEST(fuzz763_32), 7839 TEST(fuzz763_32),
7748 TEST(fuzz763_31), 7840 TEST(fuzz763_31),
7749 TEST(fuzz763_30), 7841 TEST(fuzz763_30),
7750 TEST(fuzz763_29), 7842 TEST(fuzz763_29),
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
7809 static struct TestDesc repTests[] = { 7901 static struct TestDesc repTests[] = {
7810 TEST(loops44i), 7902 TEST(loops44i),
7811 TEST(loops45i), 7903 TEST(loops45i),
7812 TEST(loops46i), 7904 TEST(loops46i),
7813 }; 7905 };
7814 7906
7815 DEF_TEST(PathOpsRepOp, reporter) { 7907 DEF_TEST(PathOpsRepOp, reporter) {
7816 for (int index = 0; index < 2; ++index) 7908 for (int index = 0; index < 2; ++index)
7817 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n ullptr, false); 7909 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n ullptr, false);
7818 } 7910 }
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