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

Side by Side Diff: tests/PathOpsOpTest.cpp

Issue 2103903004: fix fuzz test that exceeds numeric limit (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
« src/pathops/SkOpSegment.cpp ('K') | « 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 5927 matching lines...) Expand 10 before | Expand all | Expand 10 after
5938 path.conicTo(SkBits2Float(0x395b2d5b), SkBits2Float(0x68552768), SkBits2Float(0x 555b2df0), SkBits2Float(0x1f722a8c), SkBits2Float(0x082a212a)); // 0.000209024f , 4.02636e+24f, 1.50619e+13f, 5.12807e-20f, 5.11965e-34f 5938 path.conicTo(SkBits2Float(0x395b2d5b), SkBits2Float(0x68552768), SkBits2Float(0x 555b2df0), SkBits2Float(0x1f722a8c), SkBits2Float(0x082a212a)); // 0.000209024f , 4.02636e+24f, 1.50619e+13f, 5.12807e-20f, 5.11965e-34f
5939 path.lineTo(SkBits2Float(0x55685b1f), SkBits2Float(0x5b2d2968)); // 1.59674e+13 f, 4.87407e+16f 5939 path.lineTo(SkBits2Float(0x55685b1f), SkBits2Float(0x5b2d2968)); // 1.59674e+13 f, 4.87407e+16f
5940 path.close(); 5940 path.close();
5941 path.moveTo(SkBits2Float(0x212a8c55), SkBits2Float(0x21081f2a)); // 5.7784e-19f , 4.61198e-19f 5941 path.moveTo(SkBits2Float(0x212a8c55), SkBits2Float(0x21081f2a)); // 5.7784e-19f , 4.61198e-19f
5942 path.conicTo(SkBits2Float(0x6a4b7bc0), SkBits2Float(0x2147ed7a), SkBits2Float(0x 28282a3a), SkBits2Float(0x21df212a), SkBits2Float(0x033a8a3a)); // 6.14991e+25f , 6.77381e-19f, 9.33503e-15f, 1.51198e-18f, 5.48192e-37f 5942 path.conicTo(SkBits2Float(0x6a4b7bc0), SkBits2Float(0x2147ed7a), SkBits2Float(0x 28282a3a), SkBits2Float(0x21df212a), SkBits2Float(0x033a8a3a)); // 6.14991e+25f , 6.77381e-19f, 9.33503e-15f, 1.51198e-18f, 5.48192e-37f
5943 5943
5944 SkPath path2(path); 5944 SkPath path2(path);
5945 testPathFailSkipAssertOp(reporter, path1, path2, (SkPathOp) 1, filename); 5945 testPathFailSkipAssertOp(reporter, path1, path2, (SkPathOp) 1, filename);
5946 } 5946 }
5947 5947
5948 static void fuzz763_3(skiatest::Reporter* reporter, const char* filename) {
5949 SkPath path;
5950 path.setFillType((SkPath::FillType) 1);
5951
5952 SkPath path1(path);
5953 path.reset();
5954 path.setFillType((SkPath::FillType) 0);
5955 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
5956 path.lineTo(SkBits2Float(0x555b292d), SkBits2Float(0x2a212a8c)); // 1.50606e+13 f, 1.43144e-13f
5957 path.conicTo(SkBits2Float(0xc0032108), SkBits2Float(0x7a6a4b7b), SkBits2Float(0x 212a8ced), SkBits2Float(0x295b2d1f), SkBits2Float(0x29685568)); // -2.04889f, 3 .04132e+35f, 5.77848e-19f, 4.86669e-14f, 5.15884e-14f
5958 path.conicTo(SkBits2Float(0x8c28295b), SkBits2Float(0x1f21212a), SkBits2Float(0x c0032a08), SkBits2Float(0x7a6a4b7b), SkBits2Float(0x212a8ced)); // -1.29547e-31 f, 3.41205e-20f, -2.04944f, 3.04132e+35f, 5.77848e-19f
5959 path.moveTo(SkBits2Float(0x25682929), SkBits2Float(0x212a8c5b)); // 2.01367e-16 f, 5.7784e-19f
5960 path.moveTo(SkBits2Float(0x0321081f), SkBits2Float(0x6a4a7bc0)); // 4.7323e-37f , 6.11969e+25f
5961 path.conicTo(SkBits2Float(0x032108ed), SkBits2Float(0x283a7bc0), SkBits2Float(0x 47ed7a6a), SkBits2Float(0x282a3a21), SkBits2Float(0x3a21ff28)); // 4.73239e-37f , 1.03519e-14f, 121589, 9.4495e-15f, 0.000617968f
5962 path.quadTo(SkBits2Float(0x8a284f9a), SkBits2Float(0x3ac23ab3), SkBits2Float(0x2 a292827), SkBits2Float(0x962be61d)); // -8.10388e-33f, 0.00148185f, 1.50241e-13 f, -1.38859e-25f
5963 path.lineTo(SkBits2Float(0x295b2d2a), SkBits2Float(0x2d296868)); // 4.86669e-14 f, 9.62972e-12f
5964 path.moveTo(SkBits2Float(0x212a8c55), SkBits2Float(0x21081f2a)); // 5.7784e-19f , 4.61198e-19f
5965 path.conicTo(SkBits2Float(0x6a4b7bc0), SkBits2Float(0x898ced7a), SkBits2Float(0x 21081f21), SkBits2Float(0x3a7bc003), SkBits2Float(0x47ed7a6a)); // 6.14991e+25f , -3.39271e-33f, 4.61198e-19f, 0.00096035f, 121589
5966 path.lineTo(SkBits2Float(0x212a8c55), SkBits2Float(0x21081f2a)); // 5.7784e-19f , 4.61198e-19f
5967 path.close();
5968 path.moveTo(SkBits2Float(0x212a8c55), SkBits2Float(0x21081f2a)); // 5.7784e-19f , 4.61198e-19f
5969 path.quadTo(SkBits2Float(0xdf28282a), SkBits2Float(0x3a8a3a21), SkBits2Float(0xb 38a281a), SkBits2Float(0x29283ac2)); // -1.2117e+19f, 0.00105459f, -6.43342e-08 f, 3.73545e-14f
5970 path.moveTo(SkBits2Float(0x962be61d), SkBits2Float(0x432a2927)); // -1.38859e-2 5f, 170.161f
5971 path.conicTo(SkBits2Float(0x3a2a552a), SkBits2Float(0x3b1e2ab0), SkBits2Float(0x 29272021), SkBits2Float(0x3b3ac527), SkBits2Float(0x1fc42236)); // 0.000649768f , 0.00241343f, 3.71093e-14f, 0.00284989f, 8.30658e-20f
5972 path.cubicTo(SkBits2Float(0x27576c2a), SkBits2Float(0x5921c25d), SkBits2Float(0x 51503a70), SkBits2Float(0x12102a10), SkBits2Float(0x633a28d9), SkBits2Float(0x29 c80927)); // 2.98959e-15f, 2.8457e+15f, 5.58959e+10f, 4.54902e-28f, 3.43404e+21 f, 8.88337e-14f
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
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
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
5979 SkPath path2(path);
5980 testPathSkipAssertOp(reporter, path1, path2, (SkPathOp) 1, filename);
5981 }
5982
5948 static struct TestDesc failTests[] = { 5983 static struct TestDesc failTests[] = {
5984 TEST(fuzz763_3),
5949 TEST(fuzz763_4), 5985 TEST(fuzz763_4),
5950 TEST(fuzz763_9), 5986 TEST(fuzz763_9),
5951 TEST(fuzz1450_1), 5987 TEST(fuzz1450_1),
5952 TEST(fuzz1450_0), 5988 TEST(fuzz1450_0),
5953 TEST(bug597926_0), 5989 TEST(bug597926_0),
5954 TEST(fuzz535151), 5990 TEST(fuzz535151),
5955 TEST(fuzz753_91), 5991 TEST(fuzz753_91),
5956 TEST(fuzz714), 5992 TEST(fuzz714),
5957 TEST(fuzz487a), 5993 TEST(fuzz487a),
5958 TEST(fuzz433), 5994 TEST(fuzz433),
5959 TEST(fuzz1), 5995 TEST(fuzz1),
5960 TEST(fuzz487b), 5996 TEST(fuzz487b),
5961 TEST(fuzz433b), 5997 TEST(fuzz433b),
5962 TEST(bufferOverflow), 5998 TEST(bufferOverflow),
5963 }; 5999 };
5964 6000
5965 static const size_t failTestCount = SK_ARRAY_COUNT(failTests); 6001 static const size_t failTestCount = SK_ARRAY_COUNT(failTests);
5966 6002
5967 DEF_TEST(PathOpsFailOp, reporter) { 6003 DEF_TEST(PathOpsFailOp, reporter) {
5968 #if DEBUG_SHOW_TEST_NAME 6004 #if DEBUG_SHOW_TEST_NAME
5969 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); 6005 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
5970 #endif 6006 #endif
5971 RunTestSet(reporter, failTests, failTestCount, nullptr, nullptr, nullptr, fa lse); 6007 RunTestSet(reporter, failTests, failTestCount, nullptr, nullptr, nullptr, fa lse);
5972 } 6008 }
OLDNEW
« src/pathops/SkOpSegment.cpp ('K') | « src/pathops/SkPathOpsTSect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698