Chromium Code Reviews| Index: crosstest/mem_intrin_main.cpp |
| diff --git a/crosstest/mem_intrin_main.cpp b/crosstest/mem_intrin_main.cpp |
| index b529273f8b59344ccef66d5d6d264d6e30ca32d7..44641760541f6a16e60de4dc7058a154314cbef1 100644 |
| --- a/crosstest/mem_intrin_main.cpp |
| +++ b/crosstest/mem_intrin_main.cpp |
| @@ -13,48 +13,46 @@ namespace Subzero_ { |
| #define STR(s) #s |
| void testFixedLen(size_t &TotalTests, size_t &Passes, size_t &Failures) { |
| -#define do_test_fixed(test_func) \ |
| - for (uint8_t init_val = 0; init_val < 100; ++init_val) { \ |
| - ++TotalTests; \ |
| - int llc_result = test_func(init_val); \ |
| - int sz_result = Subzero_::test_func(init_val); \ |
| - if (llc_result == sz_result) { \ |
| - ++Passes; \ |
| - } else { \ |
| - ++Failures; \ |
| - printf("Failure (%s): init_val=%d, llc=%d, sz=%d\n", \ |
| - STR(test_func), init_val, llc_result, sz_result); \ |
| - } \ |
| +#define do_test_fixed(test_func) \ |
| + for (uint8_t init_val = 0; init_val < 100; ++init_val) { \ |
| + ++TotalTests; \ |
| + int llc_result = test_func(init_val); \ |
| + int sz_result = Subzero_::test_func(init_val); \ |
| + if (llc_result == sz_result) { \ |
| + ++Passes; \ |
| + } else { \ |
| + ++Failures; \ |
| + printf("Failure (%s): init_val=%d, llc=%d, sz=%d\n", STR(test_func), \ |
| + init_val, llc_result, sz_result); \ |
| + } \ |
| } |
| - do_test_fixed(memcpy_test_fixed_len) |
| - do_test_fixed(memmove_test_fixed_len) |
| - do_test_fixed(memset_test_fixed_len) |
| + do_test_fixed(memcpy_test_fixed_len) do_test_fixed(memmove_test_fixed_len) |
|
jvoung (off chromium)
2015/01/27 18:08:11
This is a bit odd. I wonder if having semi-colons
Jim Stichnoth
2015/01/27 19:24:11
Right - adding semicolons fixed it.
|
| + do_test_fixed(memset_test_fixed_len) |
| #undef do_test_fixed |
| } |
| void testVariableLen(size_t &TotalTests, size_t &Passes, size_t &Failures) { |
| uint8_t buf[256]; |
| uint8_t buf2[256]; |
| -#define do_test_variable(test_func) \ |
| - for (size_t len = 4; len < 128; ++len) { \ |
| - for (uint8_t init_val = 0; init_val < 100; ++init_val) { \ |
| - ++TotalTests; \ |
| - int llc_result = test_func(buf, buf2, init_val, len); \ |
| - int sz_result = Subzero_::test_func(buf, buf2, init_val, len); \ |
| - if (llc_result == sz_result) { \ |
| - ++Passes; \ |
| - } else { \ |
| - ++Failures; \ |
| - printf("Failure (%s): init_val=%d, len=%d, llc=%d, sz=%d\n", \ |
| - STR(test_func), init_val, len, llc_result, sz_result); \ |
| - } \ |
| - } \ |
| +#define do_test_variable(test_func) \ |
| + for (size_t len = 4; len < 128; ++len) { \ |
| + for (uint8_t init_val = 0; init_val < 100; ++init_val) { \ |
| + ++TotalTests; \ |
| + int llc_result = test_func(buf, buf2, init_val, len); \ |
| + int sz_result = Subzero_::test_func(buf, buf2, init_val, len); \ |
| + if (llc_result == sz_result) { \ |
| + ++Passes; \ |
| + } else { \ |
| + ++Failures; \ |
| + printf("Failure (%s): init_val=%d, len=%d, llc=%d, sz=%d\n", \ |
| + STR(test_func), init_val, len, llc_result, sz_result); \ |
| + } \ |
| + } \ |
| } |
| - do_test_variable(memcpy_test) |
| - do_test_variable(memmove_test) |
| - do_test_variable(memset_test) |
| + do_test_variable(memcpy_test) do_test_variable(memmove_test) |
|
jvoung (off chromium)
2015/01/27 18:08:11
similar
Jim Stichnoth
2015/01/27 19:24:11
Done.
|
| + do_test_variable(memset_test) |
| #undef do_test_variable |
| } |