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

Unified Diff: tests/PathTest.cpp

Issue 1262143002: rewrite path.getBounds test to work-around compiler bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « 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 abe8b39590d7c58b1c7fefa1bf098c301711cb5b..8272692167d5de54ee35f00b759c0389485cb2a6 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -568,9 +568,19 @@ static void test_clipped_cubic() {
}
}
+static void dump_if_ne(skiatest::Reporter* reporter, const SkRect& expected, const SkRect& bounds) {
+ if (expected != bounds) {
+ ERRORF(reporter, "path.getBounds() returned [%g %g %g %g], but expected [%g %g %g %g]",
+ bounds.left(), bounds.top(), bounds.right(), bounds.bottom(),
+ expected.left(), expected.top(), expected.right(), expected.bottom());
+ }
+}
+
static void test_bounds_crbug_513799(skiatest::Reporter* reporter) {
SkPath path;
-
+#if 0
+ // As written these tests were failing on LLVM 4.2 MacMini Release mysteriously, so we've
mtklein 2015/07/29 15:34:14 I don't think this is an llvm-gcc-4.2 bot. We hav
+ // rewritten them to avoid this (compiler-bug?).
REPORTER_ASSERT(reporter, SkRect::MakeLTRB(0, 0, 0, 0) == path.getBounds());
path.moveTo(-5, -8);
@@ -581,6 +591,18 @@ static void test_bounds_crbug_513799(skiatest::Reporter* reporter) {
path.moveTo(1, 2);
REPORTER_ASSERT(reporter, SkRect::MakeLTRB(-5, -8, 3, 4) == path.getBounds());
+#else
+ dump_if_ne(reporter, SkRect::MakeLTRB(0, 0, 0, 0), path.getBounds());
+
+ path.moveTo(-5, -8); // should set the bounds
+ dump_if_ne(reporter, SkRect::MakeLTRB(-5, -8, -5, -8), path.getBounds());
+
+ path.addRect(SkRect::MakeLTRB(1, 2, 3, 4)); // should extend the bounds
+ dump_if_ne(reporter, SkRect::MakeLTRB(-5, -8, 3, 4), path.getBounds());
+
+ path.moveTo(1, 2); // don't expect this to have changed the bounds
+ dump_if_ne(reporter, SkRect::MakeLTRB(-5, -8, 3, 4), path.getBounds());
+#endif
}
// Inspired by http://ie.microsoft.com/testdrive/Performance/Chalkboard/
« 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