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

Unified Diff: tests/PathTest.cpp

Issue 27513003: add disabled tests, in pref for experimental isRect behavior (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathTest.cpp
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 61f06e099eb20d5b1689939b139cac6307089ed1..c47b2c4858d6f9ff3f2351c4a2db25fe484ca8aa 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -1312,9 +1312,31 @@ static void test_conservativelyContains(skiatest::Reporter* reporter) {
}
+static void test_isRect_open_close(skiatest::Reporter* reporter) {
+ SkPath path;
+ bool isClosed;
+
+ path.moveTo(0, 0); path.lineTo(1, 0); path.lineTo(1, 1); path.lineTo(0, 1);
+
+ if (false) {
+ // I think these should pass, but isRect() doesn't behave
+ // this way... yet
+ REPORTER_ASSERT(reporter, path.isRect(NULL, NULL));
+ REPORTER_ASSERT(reporter, path.isRect(&isClosed, NULL));
+ REPORTER_ASSERT(reporter, !isClosed);
+ }
+
+ path.close();
+ REPORTER_ASSERT(reporter, path.isRect(NULL, NULL));
+ REPORTER_ASSERT(reporter, path.isRect(&isClosed, NULL));
+ REPORTER_ASSERT(reporter, isClosed);
+}
+
// Simple isRect test is inline TestPath, below.
// test_isRect provides more extensive testing.
static void test_isRect(skiatest::Reporter* reporter) {
+ test_isRect_open_close(reporter);
+
// passing tests (all moveTo / lineTo...
SkPoint r1[] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
SkPoint r2[] = {{1, 0}, {1, 1}, {0, 1}, {0, 0}};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698