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

Unified Diff: tests/BitmapCopyTest.cpp

Issue 132843002: Add REPORTF test macro. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: factor 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') | tests/Test.h » ('J')
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..7028d9799a4d58f9dda33bb3f111d044d15192e2 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -21,11 +21,10 @@ 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);
+ REPORTF(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 +191,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);
+ REPORTF(reporter, ("%s [config = %s]", msg, getSkConfigName(bm1)));
}
}
@@ -247,20 +243,18 @@ 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);
+ REPORTF(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);
+ REPORTF(reporter,
+ ("SkBitmap::copyTo from %s to %s. returned %s "
+ "canCopyTo %s", gConfigName[i], gConfigName[j],
+ boolStr(success), boolStr(canSucceed)));
}
if (success) {
@@ -345,10 +339,9 @@ 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);
+ REPORTF(reporter,
+ ("getSafeSize64() negative: %s",
+ getSkConfigName(tstSafeSize)));
}
bool sizeFail = false;
// Compare against hand-computed values.
@@ -380,10 +373,9 @@ DEF_TEST(BitmapCopy, reporter) {
break;
}
if (sizeFail) {
- SkString str;
- str.printf("computeSafeSize64() wrong size: %s",
- getSkConfigName(tstSafeSize));
- reporter->reportFailed(str);
+ REPORTF(reporter,
+ ("computeSafeSize64() wrong size: %s",
+ getSkConfigName(tstSafeSize)));
}
int subW = 2;
« no previous file with comments | « no previous file | tests/BlitRowTest.cpp » ('j') | tests/Test.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698