MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / TEST_F

Function TEST_F

deps/memkind/src/test/hbw_allocator_tests.cpp:44–59  ·  view source on GitHub ↗

Test standard memory allocation and deallocation.

Source from the content-addressed store, hash-verified

42
43//Test standard memory allocation and deallocation.
44TEST_F(HbwAllocatorTests, test_TC_MEMKIND_DetaultAllocatorTest)
45{
46 const size_t size = 512;
47 hbw::allocator<size_t> allocator;
48
49 hbw::allocator<size_t>::pointer ptr = allocator.allocate(size);
50
51 ASSERT_TRUE(NULL != ptr);
52
53 //Do the actually memory writing
54 for (size_t i=0; i<size; i++) {
55 ptr[i] = i;
56 }
57
58 allocator.deallocate(ptr, size);
59}
60
61//Test address convertion functionality.
62TEST_F(HbwAllocatorTests, test_TC_MEMKIND_AddressConvertion)

Callers

nothing calls this directly

Calls 7

addressMethod · 0.80
max_sizeMethod · 0.80
allocateMethod · 0.45
deallocateMethod · 0.45
constructMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected