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

Unified Diff: tests/PathOpsCubicToQuadsTest.cpp

Issue 19374003: harden and speed up path op unit tests (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rename threaded to single Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/PathOpsCubicReduceOrderTest.cpp ('k') | tests/PathOpsDCubicTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsCubicToQuadsTest.cpp
diff --git a/tests/PathOpsCubicToQuadsTest.cpp b/tests/PathOpsCubicToQuadsTest.cpp
index 774fbae67fe0b8eafb2e00432a036b62ce0d6867..60def6dbfeca3c82a4a0f619ee1d79886098054a 100644
--- a/tests/PathOpsCubicToQuadsTest.cpp
+++ b/tests/PathOpsCubicToQuadsTest.cpp
@@ -17,6 +17,7 @@ static void test(skiatest::Reporter* reporter, const SkDCubic* cubics, const cha
int firstTest, size_t testCount) {
for (size_t index = firstTest; index < testCount; ++index) {
const SkDCubic& cubic = cubics[index];
+ SkASSERT(ValidCubic(cubic));
double precision = cubic.calcPrecision();
SkTArray<SkDQuad, true> quads;
CubicToQuads(cubic, precision, quads);
@@ -32,6 +33,7 @@ static void test(skiatest::Reporter* reporter, const SkDQuad* quadTests, const c
int firstTest, size_t testCount) {
for (size_t index = firstTest; index < testCount; ++index) {
const SkDQuad& quad = quadTests[index];
+ SkASSERT(ValidQuad(quad));
SkDCubic cubic = quad.toCubic();
double precision = cubic.calcPrecision();
SkTArray<SkDQuad, true> quads;
@@ -49,6 +51,7 @@ static void testC(skiatest::Reporter* reporter, const SkDCubic* cubics, const ch
// test if computed line end points are valid
for (size_t index = firstTest; index < testCount; ++index) {
const SkDCubic& cubic = cubics[index];
+ SkASSERT(ValidCubic(cubic));
double precision = cubic.calcPrecision();
SkTArray<SkDQuad, true> quads;
CubicToQuads(cubic, precision, quads);
@@ -71,6 +74,7 @@ static void testC(skiatest::Reporter* reporter, const SkDCubic(* cubics)[2], con
for (size_t index = firstTest; index < testCount; ++index) {
for (int idx2 = 0; idx2 < 2; ++idx2) {
const SkDCubic& cubic = cubics[index][idx2];
+ SkASSERT(ValidCubic(cubic));
double precision = cubic.calcPrecision();
SkTArray<SkDQuad, true> quads;
CubicToQuads(cubic, precision, quads);
@@ -168,6 +172,7 @@ extern const bool AVERAGE_END_POINTS;
static void oneOff(skiatest::Reporter* reporter, size_t x) {
const SkDCubic& cubic = locals[x];
+ SkASSERT(ValidCubic(cubic));
const SkPoint skcubic[4] = {
{static_cast<float>(cubic[0].fX), static_cast<float>(cubic[0].fY)},
{static_cast<float>(cubic[1].fX), static_cast<float>(cubic[1].fY)},
« no previous file with comments | « tests/PathOpsCubicReduceOrderTest.cpp ('k') | tests/PathOpsDCubicTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698