diff options
author | halcanary <halcanary@google.com> | 2016-02-24 17:59:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-24 17:59:16 -0800 |
commit | 7d57124a2a9ed7b271568fb75b3cfd949fdb313a (patch) | |
tree | 34a0d37411771ccceb3dc4537a19c8360e1f5cfb /tests/MemsetTest.cpp | |
parent | 8e9f5e39d774198a5a5d9345bc9f863e855c593b (diff) |
Unit Tests: eliminate stray SkDebugf()s.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1733113002
Review URL: https://codereview.chromium.org/1733113002
Diffstat (limited to 'tests/MemsetTest.cpp')
-rw-r--r-- | tests/MemsetTest.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/tests/MemsetTest.cpp b/tests/MemsetTest.cpp index 76412eec77..854b3c56eb 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); } } } |