Print the failed assertion before aborting in test cases
This makes it faster and easier to debug, so that you don't need to fire up a debugger just to see which assertion triggered in a failing test.
This commit is contained in:
committed by
Qi Wang
parent
65d3b5989b
commit
314c073a38
@@ -228,7 +228,10 @@ p_test_no_malloc_init(test_t *t, ...) {
|
||||
}
|
||||
|
||||
void
|
||||
p_test_fail(const char *prefix, const char *message) {
|
||||
p_test_fail(bool may_abort, const char *prefix, const char *message) {
|
||||
malloc_cprintf(NULL, NULL, "%s%s\n", prefix, message);
|
||||
test_status = test_status_fail;
|
||||
if (may_abort) {
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user