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

Unified Diff: tests/RecordDrawTest.cpp

Issue 516503003: Increase test tolerance. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: both sides Created 6 years, 4 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/RecordDrawTest.cpp
diff --git a/tests/RecordDrawTest.cpp b/tests/RecordDrawTest.cpp
index 02eb2544e64328f5d94f60b464062a2547206f6e..80f645defd7fb35f824b1f38e93b813fb7bf56ec 100644
--- a/tests/RecordDrawTest.cpp
+++ b/tests/RecordDrawTest.cpp
@@ -137,12 +137,9 @@ DEF_TEST(RecordDraw_BBH, r) {
for (int i = 0; i < bbh.entries.count(); i++) {
REPORTER_ASSERT(r, bbh.entries[i].data == (uintptr_t)i);
- if (bbh.entries[i].bounds != SkRect::MakeWH(400, 480)) {
- SkRect bounds = bbh.entries[i].bounds;
- SkDebugf("Expected %x %x %x %x, got %x %x %x %x\n",
- 0.0f, 0.0f, 400.0f, 480.0f,
- bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);
- }
- REPORTER_ASSERT(r, bbh.entries[i].bounds == SkRect::MakeWH(400, 480));
+ // We'd like to assert bounds == SkRect::MakeWH(400, 480).
+ // But we allow a little slop in recognition that float equality can be weird.
+ REPORTER_ASSERT(r, SkRect::MakeLTRB(-1, -1, 401, 481).contains(bbh.entries[i].bounds));
+ REPORTER_ASSERT(r, !SkRect::MakeLTRB(+1, +1, 399, 479).contains(bbh.entries[i].bounds));
}
}
« 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