diff options
author | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-09-04 20:56:44 +0100 |
---|---|---|
committer | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-09-04 20:56:44 +0100 |
commit | 58a9b0cfe135f6a7a274c1717702c10ac0e7ee5b (patch) | |
tree | 4b73772697e3305901015598e646deaa999c5aa5 | |
parent | da5d653de8920091fb689a85eabdfc2c34278b1b (diff) |
Make the test harness not segfault when a test fails (!)
-rw-r--r-- | c/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -52,14 +52,16 @@ void run_tests() { printf("Insufficient results\n"); pass = 0; break; - } else if (!jv_equal(expected, actual)) { + } else if (!jv_equal(jv_copy(expected), jv_copy(actual))) { printf("Expected "); - jv_dump(expected); + jv_dump(jv_copy(expected)); printf(", but got "); - jv_dump(actual); + jv_dump(jv_copy(actual)); printf("\n"); pass = 0; } + jv_free(expected); + jv_free(actual); } if (pass) { jv extra = jq_next(); |