diff options
author | Jason Evans <jasone@canonware.com> | 2014-03-30 06:14:32 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2014-03-30 06:14:32 (GMT) |
commit | e3f27cfced57ac9c3b5306947d37411479a68c2e (patch) | |
tree | 0b21e1cd9d9f57bad1a118e77a51b914157b1956 /test/src | |
parent | 9480a230054f6c2f2c816fe887147456bd89409b (diff) | |
download | jemalloc-e3f27cfced57ac9c3b5306947d37411479a68c2e.zip jemalloc-e3f27cfced57ac9c3b5306947d37411479a68c2e.tar.gz jemalloc-e3f27cfced57ac9c3b5306947d37411479a68c2e.tar.bz2 |
Fix p_test_fail()'s va_list abuse.
p_test_fail() was passing a va_list to two separate functions with the
expectation that no reset would occur. Refactor p_test_fail()'s callers
to instead format two strings and pass them to p_test_fail().
Add a missing parameter to an assert_u64_eq() call, which the compiler
warned about after the assertion macro refactoring.
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/test.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/test/src/test.c b/test/src/test.c index 6552e37..528d858 100644 --- a/test/src/test.c +++ b/test/src/test.c @@ -86,15 +86,9 @@ p_test(test_t* t, ...) } void -p_test_fail(const char *format, ...) +p_test_fail(const char *prefix, const char *message) { - va_list ap; - va_start(ap, format); - malloc_vcprintf(NULL, NULL, format, ap); - format = va_arg(ap, const char *); - malloc_vcprintf(NULL, NULL, format, ap); - va_end(ap); - malloc_printf("\n"); + malloc_cprintf(NULL, NULL, "%s%s\n", prefix, message); test_status = test_status_fail; } |