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

Unified Diff: tests/MathTest.cpp

Issue 1733113002: Unit Tests: eliminate stray SkDebugf()s. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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/BitmapTest.cpp ('k') | tests/MemsetTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/MathTest.cpp
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index de7ad1db78ed3a82c2e43aeaa87c3d11b6827a72..5bc2d0ebf7e204d6c6b2d6eec2286ecadb2bb808 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -52,9 +52,10 @@ static float std_floor(float x) {
static void test_floor_value(skiatest::Reporter* reporter, float value) {
float fast = fast_floor(value);
float std = std_floor(value);
- REPORTER_ASSERT(reporter, std == fast);
-// SkDebugf("value[%1.9f] std[%g] fast[%g] equal[%d]\n",
-// value, std, fast, std == fast);
+ if (std != fast) {
+ ERRORF(reporter, "fast_floor(%.9g) == %.9g != %.9g == std_floor(%.9g)",
+ value, fast, std, value);
+ }
}
static void test_floor(skiatest::Reporter* reporter) {
@@ -150,7 +151,7 @@ static void test_blend31() {
if (r0 != r1 && r0 != r2) {
SkDebugf("src:%d dst:%d a:%d result:%d float:%g\n",
- src, dst, a, r0, f);
+ src, dst, a, r0, f);
failed += 1;
}
if (r0 > 255) {
@@ -176,11 +177,8 @@ static void test_blend(skiatest::Reporter* reporter) {
float diff = sk_float_abs(f1 - r1);
diff = sk_float_abs(diff - 0.5f);
if (diff > (1 / 255.f)) {
-#ifdef SK_DEBUG
- SkDebugf("src:%d dst:%d a:%d result:%d float:%g\n",
- src, dst, a, r0, f1);
-#endif
- REPORTER_ASSERT(reporter, false);
+ ERRORF(reporter, "src:%d dst:%d a:%d "
+ "result:%d float:%g\n", src, dst, a, r0, f1);
}
}
}
« no previous file with comments | « tests/BitmapTest.cpp ('k') | tests/MemsetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698