diff options
author | Joachim StroĢmbergson <joachim@secworks.se> | 2015-06-02 13:57:08 +0200 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@secworks.se> | 2015-06-02 13:57:08 +0200 |
commit | d23f8319c764eaa3712c129fab9d650c21eee34d (patch) | |
tree | c783cb4715e5f4f590324faad874970e28b3d761 | |
parent | d25a3b438985399857d89536f96f569f158d1b90 (diff) |
Cleanup of result checking code to make it easier to see any errors.
-rw-r--r-- | src/model/c/src/bignum_uint32_t.c | 24 |
1 files 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++; |