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

Side by Side 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, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Test.h" 8 #include "Test.h"
9 #include "RecordTestUtils.h" 9 #include "RecordTestUtils.h"
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 recorder.scale(2, 2); 130 recorder.scale(2, 2);
131 recorder.drawRect(SkRect::MakeWH(320, 240), SkPaint()); 131 recorder.drawRect(SkRect::MakeWH(320, 240), SkPaint());
132 recorder.restore(); 132 recorder.restore();
133 133
134 SkRecordFillBounds(record, &bbh); 134 SkRecordFillBounds(record, &bbh);
135 135
136 REPORTER_ASSERT(r, bbh.entries.count() == 5); 136 REPORTER_ASSERT(r, bbh.entries.count() == 5);
137 for (int i = 0; i < bbh.entries.count(); i++) { 137 for (int i = 0; i < bbh.entries.count(); i++) {
138 REPORTER_ASSERT(r, bbh.entries[i].data == (uintptr_t)i); 138 REPORTER_ASSERT(r, bbh.entries[i].data == (uintptr_t)i);
139 139
140 if (bbh.entries[i].bounds != SkRect::MakeWH(400, 480)) { 140 // We'd like to assert bounds == SkRect::MakeWH(400, 480).
141 SkRect bounds = bbh.entries[i].bounds; 141 // But we allow a little slop in recognition that float equality can be weird.
142 SkDebugf("Expected %x %x %x %x, got %x %x %x %x\n", 142 REPORTER_ASSERT(r, SkRect::MakeLTRB(-1, -1, 401, 481).contains(bbh.entr ies[i].bounds));
143 0.0f, 0.0f, 400.0f, 480.0f, 143 REPORTER_ASSERT(r, !SkRect::MakeLTRB(+1, +1, 399, 479).contains(bbh.entr ies[i].bounds));
144 bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);
145 }
146 REPORTER_ASSERT(r, bbh.entries[i].bounds == SkRect::MakeWH(400, 480));
147 } 144 }
148 } 145 }
OLDNEW
« 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