diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2017-04-30 10:54:26 +0200 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2017-04-30 10:55:20 +0200 |
commit | 8089dcfc5d4b34b15cee1f1cc9b3124c0279d41b (patch) | |
tree | ea2d07b42ff6e3ceb6632de553dd4d36638796c9 /tests/unit/unit1604.c | |
parent | 65c6caacaee87f2b09aa03e5eed1bcbd9e356f68 (diff) | |
download | curl-8089dcfc5d4b34b15cee1f1cc9b3124c0279d41b.tar.gz |
tests: fixed OOM handling of unit tests to abort test
It's dangerous to continue to run the test when a memory alloc fails.
Diffstat (limited to 'tests/unit/unit1604.c')
-rw-r--r-- | tests/unit/unit1604.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/unit1604.c b/tests/unit/unit1604.c index 5f1ea9518..a7c2a2543 100644 --- a/tests/unit/unit1604.c +++ b/tests/unit/unit1604.c @@ -45,7 +45,7 @@ static void unit_stop(void) static char *getflagstr(int flags) { char *buf = malloc(256); - fail_unless(buf, "out of memory"); + abort_unless(buf, "out of memory"); snprintf(buf, 256, "%s,%s,%s,%s", ((flags & SANITIZE_ALLOW_COLONS) ? "SANITIZE_ALLOW_COLONS" : ""), ((flags & SANITIZE_ALLOW_PATH) ? "SANITIZE_ALLOW_PATH" : ""), @@ -57,7 +57,7 @@ static char *getflagstr(int flags) static char *getcurlcodestr(int cc) { char *buf = malloc(256); - fail_unless(buf, "out of memory"); + abort_unless(buf, "out of memory"); snprintf(buf, 256, "%s (%d)", (cc == SANITIZE_ERR_OK ? "SANITIZE_ERR_OK" : cc == SANITIZE_ERR_BAD_ARGUMENT ? "SANITIZE_ERR_BAD_ARGUMENT" : |