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); |
} |
} |
} |