From d23f8319c764eaa3712c129fab9d650c21eee34d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Tue, 2 Jun 2015 13:57:08 +0200 Subject: Cleanup of result checking code to make it easier to see any errors. --- src/model/c/src/bignum_uint32_t.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/model/c/src/bignum_uint32_t.c b/src/model/c/src/bignum_uint32_t.c index 956e755..5ae367c 100644 --- a/src/model/c/src/bignum_uint32_t.c +++ b/src/model/c/src/bignum_uint32_t.c @@ -8,14 +8,24 @@ void assertArrayEquals(uint32_t length, uint32_t *expected, uint32_t *actual) { int equals = 1; for (uint32_t i = 0; i < length; i++) equals &= expected[i] == actual[i]; - printf("%s expected: [", equals ? "PASS" : "FAIL"); - for (uint32_t i = 0; i < length - 1; i++) - printf("%8x, ", expected[i]); + printf("%s expected: \n[", equals ? "PASS" : "FAIL"); + for (uint32_t i = 0; i < length - 1; i++) { + if ((i > 0) && (!(i % 4))) + printf("\n "); + printf("0x%08x, ", expected[i]); + } + printf("0x%08x]", expected[length - 1]); + + printf("\n"); + printf("actual:\n["); + for (uint32_t i = 0; i < length - 1; i++) { + if ((i > 0) && (!(i % 4))) + printf("\n "); + printf("0x%08x, ", actual[i]); + } + printf("0x%08x]\n", actual[length - 1]); + printf("\n"); - printf("%8x] actual: [ ", expected[length - 1]); - for (uint32_t i = 0; i < length - 1; i++) - printf("%8x, ", actual[i]); - printf("%8x]\n", actual[length - 1]); assert_array_total++; if (!equals) assert_array_error++; -- cgit v1.2.3