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

Unified Diff: tests/BitmapCopyTest.cpp

Issue 132843002: Add REPORTF test macro. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: final rebase Created 6 years, 11 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 | tests/BlitRowTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/BitmapCopyTest.cpp
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index 455fc691e3ec004a3c8433d6eb095b37b68559b9..d831e5e120d8939553c9c149b5d33adf170a26a8 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -21,11 +21,9 @@ static const char* gConfigName[] = {
static void report_opaqueness(skiatest::Reporter* reporter, const SkBitmap& src,
const SkBitmap& dst) {
- SkString str;
- str.printf("src %s opaque:%d, dst %s opaque:%d",
- gConfigName[src.config()], src.isOpaque(),
- gConfigName[dst.config()], dst.isOpaque());
- reporter->reportFailed(str);
+ ERRORF(reporter, "src %s opaque:%d, dst %s opaque:%d",
+ gConfigName[src.config()], src.isOpaque(),
+ gConfigName[dst.config()], dst.isOpaque());
}
static bool canHaveAlpha(SkBitmap::Config config) {
@@ -192,10 +190,7 @@ static void reportCopyVerification(const SkBitmap& bm1, const SkBitmap& bm2,
}
if (!success) {
- SkString str;
- str.printf("%s [config = %s]",
- msg, getSkConfigName(bm1));
- reporter->reportFailed(str);
+ ERRORF(reporter, "%s [config = %s]", msg, getSkConfigName(bm1));
}
}
@@ -247,20 +242,16 @@ DEF_TEST(BitmapCopy, reporter) {
bool success = srcPremul.copyTo(&dst, gPairs[j].fConfig);
bool expected = gPairs[i].fValid[j] != '0';
if (success != expected) {
- SkString str;
- str.printf("SkBitmap::copyTo from %s to %s. expected %s returned %s",
- gConfigName[i], gConfigName[j], boolStr(expected),
- boolStr(success));
- reporter->reportFailed(str);
+ ERRORF(reporter, "SkBitmap::copyTo from %s to %s. expected %s "
+ "returned %s", gConfigName[i], gConfigName[j],
+ boolStr(expected), boolStr(success));
}
bool canSucceed = srcPremul.canCopyTo(gPairs[j].fConfig);
if (success != canSucceed) {
- SkString str;
- str.printf("SkBitmap::copyTo from %s to %s. returned %s canCopyTo %s",
- gConfigName[i], gConfigName[j], boolStr(success),
- boolStr(canSucceed));
- reporter->reportFailed(str);
+ ERRORF(reporter, "SkBitmap::copyTo from %s to %s. returned %s "
+ "canCopyTo %s", gConfigName[i], gConfigName[j],
+ boolStr(success), boolStr(canSucceed));
}
if (success) {
@@ -345,10 +336,8 @@ DEF_TEST(BitmapCopy, reporter) {
100000000U);
int64_t safeSize = tstSafeSize.computeSafeSize64();
if (safeSize < 0) {
- SkString str;
- str.printf("getSafeSize64() negative: %s",
- getSkConfigName(tstSafeSize));
- reporter->reportFailed(str);
+ ERRORF(reporter, "getSafeSize64() negative: %s",
+ getSkConfigName(tstSafeSize));
}
bool sizeFail = false;
// Compare against hand-computed values.
@@ -380,10 +369,8 @@ DEF_TEST(BitmapCopy, reporter) {
break;
}
if (sizeFail) {
- SkString str;
- str.printf("computeSafeSize64() wrong size: %s",
- getSkConfigName(tstSafeSize));
- reporter->reportFailed(str);
+ ERRORF(reporter, "computeSafeSize64() wrong size: %s",
+ getSkConfigName(tstSafeSize));
}
int subW = 2;
« no previous file with comments | « no previous file | tests/BlitRowTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698