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

Side by Side Diff: tests/PathOpsOpTest.cpp

Issue 1394503003: fix some pathops bugs found in 1M skps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: init to avoid warning Created 5 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 | « tests/PathOpsExtendedTest.cpp ('k') | tests/PathOpsSimplifyTest.cpp » ('j') | 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 5640 matching lines...) Expand 10 before | Expand all | Expand 10 after
5651 path.cubicTo(SkBits2Float(0x4272cccc), SkBits2Float(0x4303199a), SkBits2Float(0x 423d3332), SkBits2Float(0x430de667), SkBits2Float(0x422d9999), SkBits2Float(0x43 1cb334)); 5651 path.cubicTo(SkBits2Float(0x4272cccc), SkBits2Float(0x4303199a), SkBits2Float(0x 423d3332), SkBits2Float(0x430de667), SkBits2Float(0x422d9999), SkBits2Float(0x43 1cb334));
5652 path.lineTo(SkBits2Float(0x7086a1dc), SkBits2Float(0x42eecccd)); 5652 path.lineTo(SkBits2Float(0x7086a1dc), SkBits2Float(0x42eecccd));
5653 path.lineTo(SkBits2Float(0x41eb3333), SkBits2Float(0xc12ccccd)); 5653 path.lineTo(SkBits2Float(0x41eb3333), SkBits2Float(0xc12ccccd));
5654 path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd)); 5654 path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd));
5655 path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334)); 5655 path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334));
5656 path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x 43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43 080000)); 5656 path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x 43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43 080000));
5657 path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000)); 5657 path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5658 path.close(); 5658 path.close();
5659 5659
5660 SkPath path2(path); 5660 SkPath path2(path);
5661 testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFai l); 5661 testPathOpFailCheck(reporter, path1, path2, (SkPathOp) 2, filename);
5662 } 5662 }
5663 5663
5664 static void fuzz487b(skiatest::Reporter* reporter, const char* filename) { 5664 static void fuzz487b(skiatest::Reporter* reporter, const char* filename) {
5665 SkPath path; 5665 SkPath path;
5666 path.setFillType((SkPath::FillType) 0); 5666 path.setFillType((SkPath::FillType) 0);
5667 path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000)); 5667 path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5668 path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000)); 5668 path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000));
5669 path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x429a6666), SkBits2Float(0x 42f9999a), SkBits2Float(0x4275999a), SkBits2Float(0x42d70001), SkBits2Float(0x42 633333)); 5669 path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x429a6666), SkBits2Float(0x 42f9999a), SkBits2Float(0x4275999a), SkBits2Float(0x42d70001), SkBits2Float(0x42 633333));
5670 path.lineTo(SkBits2Float(0x42e90001), SkBits2Float(0x41b8cccc)); 5670 path.lineTo(SkBits2Float(0x42e90001), SkBits2Float(0x41b8cccc));
5671 path.cubicTo(SkBits2Float(0x42dc6667), SkBits2Float(0x41ab3332), SkBits2Float(0x 42cf3334), SkBits2Float(0x41a3ffff), SkBits2Float(0x42c20001), SkBits2Float(0x41 a3ffff)); 5671 path.cubicTo(SkBits2Float(0x42dc6667), SkBits2Float(0x41ab3332), SkBits2Float(0x 42cf3334), SkBits2Float(0x41a3ffff), SkBits2Float(0x42c20001), SkBits2Float(0x41 a3ffff));
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
5749 5749
5750 SkPath path1(path); 5750 SkPath path1(path);
5751 path.reset(); 5751 path.reset();
5752 path.setFillType((SkPath::FillType) 0); 5752 path.setFillType((SkPath::FillType) 0);
5753 5753
5754 SkPath path2(path); 5754 SkPath path2(path);
5755 testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename); 5755 testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename);
5756 } 5756 }
5757 5757
5758 static struct TestDesc failTests[] = { 5758 static struct TestDesc failTests[] = {
5759 TEST(fuzz714),
5759 TEST(fuzz487a), 5760 TEST(fuzz487a),
5760 TEST(fuzz433), 5761 TEST(fuzz433),
5761 TEST(fuzz1), 5762 TEST(fuzz1),
5762 TEST(fuzz714),
5763 TEST(fuzz487b), 5763 TEST(fuzz487b),
5764 TEST(fuzz433b), 5764 TEST(fuzz433b),
5765 TEST(bufferOverflow), 5765 TEST(bufferOverflow),
5766 }; 5766 };
5767 5767
5768 static const size_t failTestCount = SK_ARRAY_COUNT(failTests); 5768 static const size_t failTestCount = SK_ARRAY_COUNT(failTests);
5769 5769
5770 DEF_TEST(PathOpsFailOp, reporter) { 5770 DEF_TEST(PathOpsFailOp, reporter) {
5771 #if DEBUG_SHOW_TEST_NAME 5771 #if DEBUG_SHOW_TEST_NAME
5772 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); 5772 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
5773 #endif 5773 #endif
5774 RunTestSet(reporter, failTests, failTestCount, nullptr, nullptr, nullptr, fa lse); 5774 RunTestSet(reporter, failTests, failTestCount, nullptr, nullptr, nullptr, fa lse);
5775 } 5775 }
OLDNEW
« no previous file with comments | « tests/PathOpsExtendedTest.cpp ('k') | tests/PathOpsSimplifyTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698