diff options
Diffstat (limited to 'mempool/test')
-rw-r--r-- | mempool/test/mempool_test.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mempool/test/mempool_test.c b/mempool/test/mempool_test.c index 843f7e7..4c55e4b 100644 --- a/mempool/test/mempool_test.c +++ b/mempool/test/mempool_test.c | |||
@@ -178,16 +178,18 @@ TEST_CASE(mem_clear_then_reuse) { | |||
178 | 178 | ||
179 | // Allocate chunks, contents not important. | 179 | // Allocate chunks, contents not important. |
180 | for (int i = 0; i < NUM_BLOCKS; ++i) { | 180 | for (int i = 0; i < NUM_BLOCKS; ++i) { |
181 | int* chunk = mempool_alloc(&mem); | 181 | const int* chunk = mempool_alloc(&mem); |
182 | TEST_TRUE(chunk != 0); | 182 | TEST_TRUE(chunk != nullptr); |
183 | } | 183 | } |
184 | 184 | ||
185 | mempool_clear(&mem); | 185 | mempool_clear(&mem); |
186 | TEST_EQUAL(mempool_size(&mem), 0); | ||
187 | TEST_EQUAL(mempool_capacity(&mem), NUM_BLOCKS); | ||
186 | 188 | ||
187 | // Allocate chunks and assign values 0..N. | 189 | // Allocate chunks and assign values 0..N. |
188 | for (int i = 0; i < NUM_BLOCKS; ++i) { | 190 | for (int i = 0; i < NUM_BLOCKS; ++i) { |
189 | int* chunk = mempool_alloc(&mem); | 191 | int* chunk = mempool_alloc(&mem); |
190 | TEST_TRUE(chunk != 0); | 192 | TEST_TRUE(chunk != nullptr); |
191 | *chunk = i + 1; | 193 | *chunk = i + 1; |
192 | } | 194 | } |
193 | 195 | ||