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

Side by Side Diff: tests/PathOpsOpTest.cpp

Issue 2103863005: fix another pathops fuzz bug (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/SkPathOpsOp.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 5962 matching lines...) Expand 10 before | Expand all | Expand 10 after
5973 path.lineTo(SkBits2Float(0x272927b0), SkBits2Float(0x5b392929)); // 2.3475e-15f , 5.21181e+16f 5973 path.lineTo(SkBits2Float(0x272927b0), SkBits2Float(0x5b392929)); // 2.3475e-15f , 5.21181e+16f
5974 path.moveTo(SkBits2Float(0x3a1127b4), SkBits2Float(0x2921ee3b)); // 0.000553723 f, 3.59558e-14f 5974 path.moveTo(SkBits2Float(0x3a1127b4), SkBits2Float(0x2921ee3b)); // 0.000553723 f, 3.59558e-14f
5975 path.cubicTo(SkBits2Float(0x5e215d3b), SkBits2Float(0x7828ee3a), SkBits2Float(0x 8e28b03b), SkBits2Float(0x50783be8), SkBits2Float(0x9e0b8a3a), SkBits2Float(0x55 5b2d68)); // 2.90688e+18f, 1.37053e+34f, -2.07925e-30f, 1.66587e+10f, -7.38718e -21f, 1.50618e+13f 5975 path.cubicTo(SkBits2Float(0x5e215d3b), SkBits2Float(0x7828ee3a), SkBits2Float(0x 8e28b03b), SkBits2Float(0x50783be8), SkBits2Float(0x9e0b8a3a), SkBits2Float(0x55 5b2d68)); // 2.90688e+18f, 1.37053e+34f, -2.07925e-30f, 1.66587e+10f, -7.38718e -21f, 1.50618e+13f
5976 path.moveTo(SkBits2Float(0x21081f3f), SkBits2Float(0x9fd4e62a)); // 4.61199e-19 f, -9.01663e-20f 5976 path.moveTo(SkBits2Float(0x21081f3f), SkBits2Float(0x9fd4e62a)); // 4.61199e-19 f, -9.01663e-20f
5977 path.cubicTo(SkBits2Float(0x3a293a2a), SkBits2Float(0x0e3bf0c5), SkBits2Float(0x 3b29d42a), SkBits2Float(0x0f217265), SkBits2Float(0x2d5d2921), SkBits2Float(0x55 68295b)); // 0.000645551f, 2.31655e-30f, 0.00259138f, 7.95994e-30f, 1.25715e-11 f, 1.5954e+13f 5977 path.cubicTo(SkBits2Float(0x3a293a2a), SkBits2Float(0x0e3bf0c5), SkBits2Float(0x 3b29d42a), SkBits2Float(0x0f217265), SkBits2Float(0x2d5d2921), SkBits2Float(0x55 68295b)); // 0.000645551f, 2.31655e-30f, 0.00259138f, 7.95994e-30f, 1.25715e-11 f, 1.5954e+13f
5978 5978
5979 SkPath path2(path); 5979 SkPath path2(path);
5980 testPathSkipAssertOp(reporter, path1, path2, (SkPathOp) 1, filename); 5980 testPathSkipAssertOp(reporter, path1, path2, (SkPathOp) 1, filename);
5981 } 5981 }
5982 5982
5983 static void fuzz763_5(skiatest::Reporter* reporter, const char* filename) {
5984 SkPath path;
5985 path.setFillType((SkPath::FillType) 1);
5986
5987 SkPath path1(path);
5988 path.reset();
5989 path.setFillType((SkPath::FillType) 0);
5990 path.moveTo(SkBits2Float(0x5b292d55), SkBits2Float(0x2a2a8c55)); // 4.76191e+16 f, 1.51477e-13f
5991 path.conicTo(SkBits2Float(0xc0032108), SkBits2Float(0x7a6a4b79), SkBits2Float(0x 212a8ced), SkBits2Float(0x0321081f), SkBits2Float(0x6a3a7bc0)); // -2.04889f, 3 .04132e+35f, 5.77848e-19f, 4.7323e-37f, 5.63611e+25f
5992 path.conicTo(SkBits2Float(0x3a2147ed), SkBits2Float(0xdf28282a), SkBits2Float(0x 3a8a3a21), SkBits2Float(0x8a284f9a), SkBits2Float(0x3ac23ab3)); // 0.000615238f , -1.2117e+19f, 0.00105459f, -8.10388e-33f, 0.00148185f
5993 path.cubicTo(SkBits2Float(0xe62a2928), SkBits2Float(0x2a63962b), SkBits2Float(0x 68295b2d), SkBits2Float(0x2d296855), SkBits2Float(0x2a8c555b), SkBits2Float(0x00 1f2a21)); // -2.0089e+23f, 2.02138e-13f, 3.19905e+24f, 9.6297e-12f, 2.49282e-13 f, 2.86201e-39f
5994 path.lineTo(SkBits2Float(0x5b292d55), SkBits2Float(0x2a2a8c55)); // 4.76191e+16 f, 1.51477e-13f
5995 path.close();
5996 path.moveTo(SkBits2Float(0x5b292d55), SkBits2Float(0x2a2a8c55)); // 4.76191e+16 f, 1.51477e-13f
5997 path.conicTo(SkBits2Float(0x6a4b7bc0), SkBits2Float(0x2a8ced7a), SkBits2Float(0x 21081f21), SkBits2Float(0x3a7bc003), SkBits2Float(0x47ed7a6a)); // 6.14991e+25f , 2.50338e-13f, 4.61198e-19f, 0.00096035f, 121589
5998 path.lineTo(SkBits2Float(0x5b292d55), SkBits2Float(0x2a2a8c55)); // 4.76191e+16 f, 1.51477e-13f
5999 path.close();
6000 path.moveTo(SkBits2Float(0x5b292d55), SkBits2Float(0x2a2a8c55)); // 4.76191e+16 f, 1.51477e-13f
6001 path.quadTo(SkBits2Float(0xdf28282a), SkBits2Float(0x3a8a3b21), SkBits2Float(0x2 8ee4f9a), SkBits2Float(0x68293b78)); // -1.2117e+19f, 0.00105462f, 2.64578e-14f , 3.19671e+24f
6002 path.lineTo(SkBits2Float(0x5b2d2968), SkBits2Float(0x5b2d8c55)); // 4.87407e+16 f, 4.88495e+16f
6003
6004 SkPath path2(path);
6005 testPathSkipAssertOp(reporter, path1, path2, (SkPathOp) 4, filename);
6006 }
6007
6008 static void fuzz763_2(skiatest::Reporter* reporter, const char* filename) {
6009 SkPath path;
6010 path.setFillType((SkPath::FillType) 1);
6011
6012 SkPath path1(path);
6013 path.reset();
6014 path.setFillType((SkPath::FillType) 0);
6015 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
6016 path.lineTo(SkBits2Float(0x555b292d), SkBits2Float(0x2a212a8c)); // 1.50606e+13 f, 1.43144e-13f
6017 path.conicTo(SkBits2Float(0xc0032108), SkBits2Float(0x7a6a4b7b), SkBits2Float(0x 212a8ced), SkBits2Float(0x0321081f), SkBits2Float(0x6a3a7bc0)); // -2.04889f, 3 .04132e+35f, 5.77848e-19f, 4.7323e-37f, 5.63611e+25f
6018 path.lineTo(SkBits2Float(0x081f2ad7), SkBits2Float(0x7bc00321)); // 4.78977e-34 f, 1.99397e+36f
6019 path.moveTo(SkBits2Float(0x2a3a2147), SkBits2Float(0xdf212828)); // 1.65317e-13 f, -1.16126e+19f
6020 path.quadTo(SkBits2Float(0x4f1a3a8a), SkBits2Float(0x3ab38a28), SkBits2Float(0x2 9283ac2), SkBits2Float(0x962be62a)); // 2.58753e+09f, 0.00136978f, 3.73545e-14f , -1.38859e-25f
6021 path.cubicTo(SkBits2Float(0x272a812a), SkBits2Float(0x3a2a5529), SkBits2Float(0x 3b1e2ab0), SkBits2Float(0x29272021), SkBits2Float(0x3b3ac527), SkBits2Float(0x1f c42237)); // 2.36623e-15f, 0.000649768f, 0.00241343f, 3.71093e-14f, 0.00284989f , 8.30658e-20f
6022 path.cubicTo(SkBits2Float(0x27576c2a), SkBits2Float(0x5921c25d), SkBits2Float(0x 51523a70), SkBits2Float(0x12102a10), SkBits2Float(0x633a28d9), SkBits2Float(0x29 c80927)); // 2.98959e-15f, 2.8457e+15f, 5.64327e+10f, 4.54902e-28f, 3.43404e+21 f, 8.88337e-14f
6023 path.lineTo(SkBits2Float(0x29292727), SkBits2Float(0x21475b3b)); // 3.75595e-14 f, 6.75446e-19f
6024 path.quadTo(SkBits2Float(0xdf28282a), SkBits2Float(0x3a8a3a21), SkBits2Float(0x8 a284f9a), SkBits2Float(0x3ac23ab3)); // -1.2117e+19f, 0.00105459f, -8.10388e-33 f, 0.00148185f
6025 path.cubicTo(SkBits2Float(0x682d2928), SkBits2Float(0x555b6829), SkBits2Float(0x 555b292d), SkBits2Float(0x2a212a8c), SkBits2Float(0x0321081f), SkBits2Float(0x6a 4b7bc0)); // 3.27091e+24f, 1.50775e+13f, 1.50606e+13f, 1.43144e-13f, 4.7323e-37 f, 6.14991e+25f
6026 path.conicTo(SkBits2Float(0x295b2ded), SkBits2Float(0x29685568), SkBits2Float(0x 8c555b2d), SkBits2Float(0xe61d2a2a), SkBits2Float(0x2a63962b)); // 4.86676e-14f , 5.15884e-14f, -1.64364e-31f, -1.85547e+23f, 2.02138e-13f
6027 path.conicTo(SkBits2Float(0x5568295b), SkBits2Float(0x5b2d2968), SkBits2Float(0x 212a8c55), SkBits2Float(0x21081f2a), SkBits2Float(0x4b7bc003)); // 1.5954e+13f, 4.87407e+16f, 5.7784e-19f, 4.61198e-19f, 1.64987e+07f
6028 path.lineTo(SkBits2Float(0x2a8ced7a), SkBits2Float(0x21081f21)); // 2.50338e-13 f, 4.61198e-19f
6029 path.conicTo(SkBits2Float(0x6a3a7bc0), SkBits2Float(0x2147ed7a), SkBits2Float(0x 28282a3a), SkBits2Float(0x8a3a21df), SkBits2Float(0x27b42a3a)); // 5.63611e+25f , 6.77381e-19f, 9.33503e-15f, -8.96194e-33f, 5.00058e-15f
6030 path.conicTo(SkBits2Float(0x2921217d), SkBits2Float(0x5e3a3b35), SkBits2Float(0x 7828ee3a), SkBits2Float(0x8e28b03b), SkBits2Float(0x783be82a)); // 3.57782e-14f , 3.35484e+18f, 1.37053e+34f, -2.07925e-30f, 1.52448e+34f
6031 path.conicTo(SkBits2Float(0x8e0b8a3a), SkBits2Float(0x279fd4e6), SkBits2Float(0x 7a293a2a), SkBits2Float(0x2a0ef0c5), SkBits2Float(0x653b29d4)); // -1.71996e-30 f, 4.43622e-15f, 2.19669e+35f, 1.26957e-13f, 5.52409e+22f
6032 path.quadTo(SkBits2Float(0x29210f21), SkBits2Float(0x282a085d), SkBits2Float(0xc 2ab2127), SkBits2Float(0xa6800028)); // 3.57623e-14f, 9.43871e-15f, -85.5648f, -8.88183e-16f
6033 path.lineTo(SkBits2Float(0x2a3a2147), SkBits2Float(0xdf212828)); // 1.65317e-13 f, -1.16126e+19f
6034 path.close();
6035 path.moveTo(SkBits2Float(0x2a3a2147), SkBits2Float(0xdf212828)); // 1.65317e-13 f, -1.16126e+19f
6036 path.quadTo(SkBits2Float(0x216a2770), SkBits2Float(0x2ab73b28), SkBits2Float(0x4 b28f427), SkBits2Float(0x283b5b28)); // 7.93345e-19f, 3.25484e-13f, 1.10726e+07 f, 1.04004e-14f
6037 path.lineTo(SkBits2Float(0x2a3a2147), SkBits2Float(0xdf212828)); // 1.65317e-13 f, -1.16126e+19f
6038 path.close();
6039 path.moveTo(SkBits2Float(0x2a3a2147), SkBits2Float(0xdf212828)); // 1.65317e-13 f, -1.16126e+19f
6040 path.conicTo(SkBits2Float(0xf86d273b), SkBits2Float(0x27e523e3), SkBits2Float(0x 2927e0f5), SkBits2Float(0x2ac0e729), SkBits2Float(0x6b492128)); // -1.92402e+34 f, 6.35992e-15f, 3.72766e-14f, 3.42665e-13f, 2.43151e+26f
6041 path.cubicTo(SkBits2Float(0x2f273927), SkBits2Float(0xa83a2c21), SkBits2Float(0x d7122121), SkBits2Float(0x21212921), SkBits2Float(0x3be3db3a), SkBits2Float(0xa9 deb63b)); // 1.52089e-10f, -1.03346e-14f, -1.60671e+14f, 5.46034e-19f, 0.006953 62f, -9.89039e-14f
6042
6043 SkPath path2(path);
6044 testPathSkipAssertOp(reporter, path1, path2, (SkPathOp) 1, filename);
6045 }
6046
5983 static struct TestDesc failTests[] = { 6047 static struct TestDesc failTests[] = {
6048 TEST(fuzz763_2),
6049 TEST(fuzz763_5),
5984 TEST(fuzz763_3), 6050 TEST(fuzz763_3),
5985 TEST(fuzz763_4), 6051 TEST(fuzz763_4),
5986 TEST(fuzz763_9), 6052 TEST(fuzz763_9),
5987 TEST(fuzz1450_1), 6053 TEST(fuzz1450_1),
5988 TEST(fuzz1450_0), 6054 TEST(fuzz1450_0),
5989 TEST(bug597926_0), 6055 TEST(bug597926_0),
5990 TEST(fuzz535151), 6056 TEST(fuzz535151),
5991 TEST(fuzz753_91), 6057 TEST(fuzz753_91),
5992 TEST(fuzz714), 6058 TEST(fuzz714),
5993 TEST(fuzz487a), 6059 TEST(fuzz487a),
5994 TEST(fuzz433), 6060 TEST(fuzz433),
5995 TEST(fuzz1), 6061 TEST(fuzz1),
5996 TEST(fuzz487b), 6062 TEST(fuzz487b),
5997 TEST(fuzz433b), 6063 TEST(fuzz433b),
5998 TEST(bufferOverflow), 6064 TEST(bufferOverflow),
5999 }; 6065 };
6000 6066
6001 static const size_t failTestCount = SK_ARRAY_COUNT(failTests); 6067 static const size_t failTestCount = SK_ARRAY_COUNT(failTests);
6002 6068
6003 DEF_TEST(PathOpsFailOp, reporter) { 6069 DEF_TEST(PathOpsFailOp, reporter) {
6004 #if DEBUG_SHOW_TEST_NAME 6070 #if DEBUG_SHOW_TEST_NAME
6005 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); 6071 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
6006 #endif 6072 #endif
6007 RunTestSet(reporter, failTests, failTestCount, nullptr, nullptr, nullptr, fa lse); 6073 RunTestSet(reporter, failTests, failTestCount, nullptr, nullptr, nullptr, fa lse);
6008 } 6074 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsOp.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698