4d6c315c1e
Summary: Block Allocator Test - initial implementation Test Plan: ctest -R memgraph_unit_block_allocator Reviewers: sale Subscribers: sale, buda Differential Revision: https://memgraph.phacility.com/D20
25 lines
564 B
C++
25 lines
564 B
C++
#include "gtest/gtest.h"
|
|
|
|
#include "utils/memory/block_allocator.hpp"
|
|
|
|
TEST(BlockAllocatorTest, UnusedVsReleaseSize)
|
|
{
|
|
BlockAllocator<64> block_allocator(10);
|
|
void *block = block_allocator.acquire();
|
|
block_allocator.release(block);
|
|
EXPECT_EQ(block_allocator.unused_size(), 9);
|
|
EXPECT_EQ(block_allocator.release_size(), 1);
|
|
}
|
|
|
|
TEST(BlockAllocatorTest, CountMallocAndFreeCalls)
|
|
{
|
|
// TODO: implementation
|
|
EXPECT_EQ(true, true);
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
return RUN_ALL_TESTS();
|
|
}
|