add test for zero-sized alloc and aligned alloc

This commit is contained in:
Dave Watson
2018-10-09 08:41:36 -07:00
parent 01e2a38e5a
commit 2b112ea593
3 changed files with 28 additions and 1 deletions

16
test/integration/malloc.c Normal file
View File

@@ -0,0 +1,16 @@
#include "test/jemalloc_test.h"
TEST_BEGIN(test_zero_alloc) {
void *res = malloc(0);
assert(res);
size_t usable = malloc_usable_size(res);
assert(usable > 0);
free(res);
}
TEST_END
int
main(void) {
return test(
test_zero_alloc);
}