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

Unified Diff: tests/MemsetTest.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/MathTest.cpp ('k') | tests/PDFJpegEmbedTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/MemsetTest.cpp
diff --git a/tests/MemsetTest.cpp b/tests/MemsetTest.cpp
index 76412eec7763dab629dcea475bc461341187d5f3..854b3c56eb1dba1a5e2b47a2e7895e3a2b665c9f 100644
--- a/tests/MemsetTest.cpp
+++ b/tests/MemsetTest.cpp
@@ -95,24 +95,24 @@ static void set_zero(void* dst, size_t bytes) {
#define VALUE16 0x1234
#define VALUE32 0x12345678
-static bool compare16(const uint16_t base[], uint16_t value, int count) {
+static void compare16(skiatest::Reporter* r, const uint16_t base[],
+ uint16_t value, int count) {
for (int i = 0; i < count; ++i) {
if (base[i] != value) {
- SkDebugf("[%d] expected %x found %x\n", i, value, base[i]);
- return false;
+ ERRORF(r, "[%d] expected %x found %x\n", i, value, base[i]);
+ return;
}
}
- return true;
}
-static bool compare32(const uint32_t base[], uint32_t value, int count) {
+static void compare32(skiatest::Reporter* r, const uint32_t base[],
+ uint32_t value, int count) {
for (int i = 0; i < count; ++i) {
if (base[i] != value) {
- SkDebugf("[%d] expected %x found %x\n", i, value, base[i]);
- return false;
+ ERRORF(r, "[%d] expected %x found %x\n", i, value, base[i]);
+ return;
}
}
- return true;
}
static void test_16(skiatest::Reporter* reporter) {
@@ -125,10 +125,9 @@ static void test_16(skiatest::Reporter* reporter) {
uint16_t* base = &buffer[PAD + alignment];
sk_memset16(base, VALUE16, count);
- REPORTER_ASSERT(reporter,
- compare16(buffer, 0, PAD + alignment) &&
- compare16(base, VALUE16, count) &&
- compare16(base + count, 0, TOTAL - count - PAD - alignment));
+ compare16(reporter, buffer, 0, PAD + alignment);
+ compare16(reporter, base, VALUE16, count);
+ compare16(reporter, base + count, 0, TOTAL - count - PAD - alignment);
}
}
}
@@ -143,10 +142,9 @@ static void test_32(skiatest::Reporter* reporter) {
uint32_t* base = &buffer[PAD + alignment];
sk_memset32(base, VALUE32, count);
- REPORTER_ASSERT(reporter,
- compare32(buffer, 0, PAD + alignment) &&
- compare32(base, VALUE32, count) &&
- compare32(base + count, 0, TOTAL - count - PAD - alignment));
+ compare32(reporter, buffer, 0, PAD + alignment);
+ compare32(reporter, base, VALUE32, count);
+ compare32(reporter, base + count, 0, TOTAL - count - PAD - alignment);
}
}
}
« no previous file with comments | « tests/MathTest.cpp ('k') | tests/PDFJpegEmbedTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698