Add REPORTF test macro.
This macro replaces:
SkString str;
str.printf("Foo test Expected %d got %d", x, y);
reporter->reportFailed(str);
with the shorter code:
REPORTF(reporter, ("Foo test Expected %d got %d", x, y));
The new form also appends __FILE__:__LINE__ to the message before calling reportFailed().
BUG=
R=mtklein@google.com
Review URL: https://codereview.chromium.org/132843002
git-svn-id: http://skia.googlecode.com/svn/trunk@13016 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/GpuBitmapCopyTest.cpp b/tests/GpuBitmapCopyTest.cpp
index 6e1d74d..a1434dc 100644
--- a/tests/GpuBitmapCopyTest.cpp
+++ b/tests/GpuBitmapCopyTest.cpp
@@ -150,21 +150,18 @@
bool success = src.deepCopyTo(&dst, gPairs[j].fConfig);
bool expected = gPairs[i].fValid[j] != '0';
if (success != expected) {
- SkString str;
- str.printf("SkBitmap::deepCopyTo from %s to %s. expected %s returned %s",
- gConfigName[i], gConfigName[j], boolStr(expected),
- boolStr(success));
- reporter->reportFailed(str);
+ ERRORF(reporter, "SkBitmap::deepCopyTo from %s to %s. "
+ "expected %s returned %s", gConfigName[i],
+ gConfigName[j], boolStr(expected),
+ boolStr(success));
}
bool canSucceed = src.canCopyTo(gPairs[j].fConfig);
if (success != canSucceed) {
- SkString str;
- str.printf("SkBitmap::deepCopyTo from %s to %s returned %s,"
- "but canCopyTo returned %s",
- gConfigName[i], gConfigName[j], boolStr(success),
- boolStr(canSucceed));
- reporter->reportFailed(str);
+ ERRORF(reporter, "SkBitmap::deepCopyTo from %s to %s "
+ "returned %s, but canCopyTo returned %s",
+ gConfigName[i], gConfigName[j], boolStr(success),
+ boolStr(canSucceed));
}
TestIndividualCopy(reporter, gPairs[j].fConfig, success, src, dst);