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

Method test_add_remove

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

Add and remove

Source from the content-addressed store, hash-verified

1205
1206// Add and remove
1207void test_add_remove() {
1208 FreeIndex index(largest_free_);
1209 setup(index, 1024);
1210 FreeHeader* alloc = free_block(512);
1211 index.add(alloc);
1212 EXPECT_TRUE(index.find(512, pool_ptr_) == alloc);
1213 list_remove(alloc);
1214 index.remove(alloc, alloc->larger_free(pool_ptr_));
1215 EXPECT_TRUE(index.find(512, pool_ptr_) == largest_free_);
1216}
1217
1218void test_removes() {
1219 FreeIndex index(largest_free_);

Callers 1

TESTFunction · 0.80

Calls 5

larger_freeMethod · 0.80
setupFunction · 0.50
addMethod · 0.45
findMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected