| 197 // verify that destroying old pool does nothing |
197 // verify that destroying old pool does nothing |
| 198 test_mempool_destructor_called = 0; |
198 test_mempool_destructor_called = 0; |
| 199 cxMempoolFree(src); |
199 cxMempoolFree(src); |
| 200 CX_TEST_ASSERT(test_mempool_destructor_called == 0); |
200 CX_TEST_ASSERT(test_mempool_destructor_called == 0); |
| 201 |
201 |
| |
202 // cover illegal arguments |
| |
203 result = cxMempoolTransfer(dest, dest); |
| |
204 CX_TEST_ASSERT(result != 0); |
| |
205 |
| 202 // verify that destroying new pool calls the destructors |
206 // verify that destroying new pool calls the destructors |
| 203 // but only three times (the old allocator has a different destructor) |
207 // but only three times (the old allocator has a different destructor) |
| 204 cxMempoolFree(dest); |
208 cxMempoolFree(dest); |
| 205 CX_TEST_ASSERT(test_mempool_destructor_called == 3); |
209 CX_TEST_ASSERT(test_mempool_destructor_called == 3); |
| 206 |
210 |
| 207 // free the foreign object |
211 // free the foreign object |
| 208 free(c); |
212 free(c); |
| 209 |
|
| 210 // cover illegal arguments |
|
| 211 result = cxMempoolTransfer(dest, dest); |
|
| 212 CX_TEST_ASSERT(result != 0); |
|
| 213 } |
213 } |
| 214 } |
214 } |
| 215 |
215 |
| 216 CX_TEST(test_mempool_transfer_object) { |
216 CX_TEST(test_mempool_transfer_object) { |
| 217 CxMempool *src = cxMempoolCreateSimple(4); |
217 CxMempool *src = cxMempoolCreateSimple(4); |