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

Unified Diff: tests/PathOpsBoundsTest.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/PathOpsAngleTest.cpp ('k') | tests/PathOpsCubicIntersectionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsBoundsTest.cpp
diff --git a/tests/PathOpsBoundsTest.cpp b/tests/PathOpsBoundsTest.cpp
index 9d686a5de448b863890daf022b6ce074f460dcc7..3d6091cb14f1760140d59f6084630c237d8a2f0c 100644
--- a/tests/PathOpsBoundsTest.cpp
+++ b/tests/PathOpsBoundsTest.cpp
@@ -4,6 +4,7 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+#include "PathOpsTestCommon.h"
#include "SkPathOpsBounds.h"
#include "Test.h"
@@ -48,13 +49,17 @@ static const size_t notEmptyTestsCount = SK_ARRAY_COUNT(notReallyEmpty);
static void PathOpsBoundsTest(skiatest::Reporter* reporter) {
for (size_t index = 0; index < sectTestsCount; ++index) {
const SkPathOpsBounds& bounds1 = static_cast<const SkPathOpsBounds&>(sectTests[index][0]);
+ SkASSERT(ValidBounds(bounds1));
const SkPathOpsBounds& bounds2 = static_cast<const SkPathOpsBounds&>(sectTests[index][1]);
+ SkASSERT(ValidBounds(bounds2));
bool touches = SkPathOpsBounds::Intersects(bounds1, bounds2);
REPORTER_ASSERT(reporter, touches);
}
for (size_t index = 0; index < noSectTestsCount; ++index) {
const SkPathOpsBounds& bounds1 = static_cast<const SkPathOpsBounds&>(noSectTests[index][0]);
+ SkASSERT(ValidBounds(bounds1));
const SkPathOpsBounds& bounds2 = static_cast<const SkPathOpsBounds&>(noSectTests[index][1]);
+ SkASSERT(ValidBounds(bounds2));
bool touches = SkPathOpsBounds::Intersects(bounds1, bounds2);
REPORTER_ASSERT(reporter, !touches);
}
@@ -76,11 +81,13 @@ static void PathOpsBoundsTest(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, bounds == expected);
for (size_t index = 0; index < emptyTestsCount; ++index) {
const SkPathOpsBounds& bounds = static_cast<const SkPathOpsBounds&>(reallyEmpty[index]);
+ // SkASSERT(ValidBounds(bounds)); // don't check because test may contain nan
bool empty = bounds.isReallyEmpty();
REPORTER_ASSERT(reporter, empty);
}
for (size_t index = 0; index < notEmptyTestsCount; ++index) {
const SkPathOpsBounds& bounds = static_cast<const SkPathOpsBounds&>(notReallyEmpty[index]);
+ SkASSERT(ValidBounds(bounds));
bool empty = bounds.isReallyEmpty();
REPORTER_ASSERT(reporter, !empty);
}
« no previous file with comments | « tests/PathOpsAngleTest.cpp ('k') | tests/PathOpsCubicIntersectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698