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/DataRefTest.cpp b/tests/DataRefTest.cpp
index b31bfcd..6a51392 100644
--- a/tests/DataRefTest.cpp
+++ b/tests/DataRefTest.cpp
@@ -186,9 +186,7 @@
{
SkFILEWStream writer(path.c_str());
if (!writer.isValid()) {
- SkString msg;
- msg.printf("Failed to create tmp file %s\n", path.c_str());
- reporter->reportFailed(msg);
+ ERRORF(reporter, "Failed to create tmp file %s\n", path.c_str());
return;
}
writer.write(s, 26);