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

Side by Side Diff: tests/PathOpsSimplifyTest.cpp

Issue 1463923002: fix pathops coincidence fuzz bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 8
9 #define TEST(name) { name, #name } 9 #define TEST(name) { name, #name }
10 10
(...skipping 5006 matching lines...) Expand 10 before | Expand all | Expand 10 after
5017 path.close(); 5017 path.close();
5018 path.moveTo(123, 600); 5018 path.moveTo(123, 600);
5019 path.lineTo(3.35546e+07f, 600); 5019 path.lineTo(3.35546e+07f, 600);
5020 path.lineTo(3.35546e+07f, 0); 5020 path.lineTo(3.35546e+07f, 0);
5021 path.lineTo(123, 0); 5021 path.lineTo(123, 0);
5022 path.lineTo(123, 600); 5022 path.lineTo(123, 600);
5023 path.close(); 5023 path.close();
5024 testSimplify(reporter, path, filename); 5024 testSimplify(reporter, path, filename);
5025 } 5025 }
5026 5026
5027 static void fuzz_twister2(skiatest::Reporter* reporter, const char* filename) {
5028 SkPath path;
5029
5030 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x44160000)); // 0, 600
5031 path.lineTo(SkBits2Float(0x4bfffffe), SkBits2Float(0x44160000)); // 3.35544e+07 f, 600
5032 path.lineTo(SkBits2Float(0x4bfffffe), SkBits2Float(0x00000000)); // 3.35544e+07 f, 0
5033 path.lineTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
5034 path.lineTo(SkBits2Float(0x00000000), SkBits2Float(0x44160000)); // 0, 600
5035 path.close();
5036
5037 path.moveTo(SkBits2Float(0x427c0000), SkBits2Float(0x00000000)); // 63, 0
5038 path.lineTo(SkBits2Float(0x4c00000f), SkBits2Float(0x00000000)); // 3.35545e+07 f, 0
5039 path.lineTo(SkBits2Float(0x4c00000f), SkBits2Float(0x00000000)); // 3.35545e+07 f, 0
5040 path.lineTo(SkBits2Float(0x427c0000), SkBits2Float(0x00000000)); // 63, 0
5041 path.close();
5042
5043 path.moveTo(SkBits2Float(0x42ba0000), SkBits2Float(0x00000000)); // 93, 0
5044 path.lineTo(SkBits2Float(0x4c000016), SkBits2Float(0x00000000)); // 3.35545e+07 f, 0
5045 path.lineTo(SkBits2Float(0x4c000016), SkBits2Float(0x00000000)); // 3.35545e+07 f, 0
5046 path.lineTo(SkBits2Float(0x42ba0000), SkBits2Float(0x00000000)); // 93, 0
5047 path.close();
5048
5049 path.moveTo(SkBits2Float(0x42f60000), SkBits2Float(0x00000000)); // 123, 0
5050 path.lineTo(SkBits2Float(0x4c00001e), SkBits2Float(0x00000000)); // 3.35546e+07 f, 0
5051 path.lineTo(SkBits2Float(0x4c00001e), SkBits2Float(0x00000000)); // 3.35546e+07 f, 0
5052 path.lineTo(SkBits2Float(0x42f60000), SkBits2Float(0x00000000)); // 123, 0
5053 path.close();
5054
5055 REPORTER_ASSERT(reporter, !Simplify(path, &path));
5056 }
5057
5027 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; 5058 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
5028 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; 5059 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
5029 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; 5060 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
5030 5061
5031 static TestDesc tests[] = { 5062 static TestDesc tests[] = {
5063 TEST(fuzz_twister2),
5032 TEST(fuzz_twister), 5064 TEST(fuzz_twister),
5033 TEST(fuzz994s_3414), 5065 TEST(fuzz994s_3414),
5034 TEST(fuzz994s_11), 5066 TEST(fuzz994s_11),
5035 TEST(cr514118), 5067 TEST(cr514118),
5036 TEST(fuzz864a), 5068 TEST(fuzz864a),
5037 TEST(testQuads65), 5069 TEST(testQuads65),
5038 TEST(testIssue3838_3), 5070 TEST(testIssue3838_3),
5039 TEST(testIssue3838), 5071 TEST(testIssue3838),
5040 TEST(testArc), 5072 TEST(testArc),
5041 TEST(testTriangle2), 5073 TEST(testTriangle2),
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
5475 5507
5476 DEF_TEST(PathOpsSimplify, reporter) { 5508 DEF_TEST(PathOpsSimplify, reporter) {
5477 if (runSubTests && runSubTestsFirst) { 5509 if (runSubTests && runSubTestsFirst) {
5478 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse); 5510 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse);
5479 } 5511 }
5480 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev erse); 5512 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev erse);
5481 if (runSubTests && !runSubTestsFirst) { 5513 if (runSubTests && !runSubTestsFirst) {
5482 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse); 5514 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse);
5483 } 5515 }
5484 } 5516 }
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