MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / test_pool_realloc

Method test_pool_realloc

tests/unit-tests/dds/DCPS/MemoryPool.cpp:157–167  ·  view source on GitHub ↗

Allocate a block, free it, reallocate

Source from the content-addressed store, hash-verified

155
156 // Allocate a block, free it, reallocate
157 void test_pool_realloc() {
158 MemoryPool pool(1024, 8);
159 void* ptr0 = pool.pool_alloc(128);
160 pool.pool_free(ptr0);
161 void* ptr1 = pool.pool_alloc(128);
162 validate_pool(pool, 128);
163 EXPECT_TRUE(ptr0 == ptr1);
164
165 pool.pool_free(ptr1);
166 validate_pool(pool, 0);
167 }
168
169 // Free a block and the one to its right, case II
170 void test_pool_free_join_right() {

Callers 1

TESTFunction · 0.80

Calls 2

pool_allocMethod · 0.80
pool_freeMethod · 0.80

Tested by

no test coverage detected