diff options
| author | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2025-11-02 18:29:20 -0500 |
|---|---|---|
| committer | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2025-11-02 18:29:20 -0500 |
| commit | 11521b99661f969ba7adad9d2366108a1a001ab0 (patch) | |
| tree | 5a8d1225cfd9a4b58a5277d6d7f1f5112a7cf020 /tests | |
| parent | f88198cb987ab006f3406698fec410ff1de05534 (diff) | |
| download | liballoc-11521b99661f969ba7adad9d2366108a1a001ab0.tar.gz | |
Defined allocator behavior for 0 byte requests
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/liballoc_tests.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/liballoc_tests.c b/tests/liballoc_tests.c index 16d50d6..a54998a 100644 --- a/tests/liballoc_tests.c +++ b/tests/liballoc_tests.c @@ -26,6 +26,10 @@ START_TEST(basic_allocate) { size_t alignment = (size_t)memory % ALIGNMENT; ck_assert_int_eq(alignment, 0); + /* allocating 0 size should return NULL */ + void *memory2 = allocate(0); + ck_assert_ptr_eq(memory2, NULL); + /* leak the memory--we aren't testing release */ } END_TEST |