theCore C++ embedded framework
pool_unit.cpp File Reference
#include <ecl/pool.hpp>
#include <sstream>
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <ctime>
#include <map>
#include <iostream>
#include <CppUTest/TestHarness.h>
#include <CppUTestExt/MockSupport.h>
Include dependency graph for pool_unit.cpp:

Data Structures

struct  exactly_block
 
struct  more_than_block
 
struct  less_than_block
 

Macros

#define POOL_ALLOC_TEST_PRINT_STATS
 
#define POOL_ALLOC_TEST
 

Functions

struct exactly_block __attribute__ ((packed))
 
static void check_if_empty_pool_is_empty ()
 
 TEST_GROUP (pool_unit)
 
template<typename T >
static void test_alloc_dealloc_with_type (size_t n, size_t blk_cnt)
 
 TEST (pool_unit, multiple_alloc_dealloc_of_block_type)
 
 TEST (pool_unit, too_big_allocation)
 
 TEST (pool_unit, depleted_pool)
 
 TEST (pool_unit, single_alloc_dealloc)
 
 TEST (pool_unit, randomly_allocate_and_deallocate)
 

Variables

static constexpr auto block_size = 16
 
static constexpr auto blocks = 100
 
static ecl::pool_basetest_pool
 
static ecl::pool< block_size, blocks > * real_pool
 
char data [block_size]
 

Macro Definition Documentation

◆ POOL_ALLOC_TEST_PRINT_STATS

#define POOL_ALLOC_TEST_PRINT_STATS

◆ POOL_ALLOC_TEST

#define POOL_ALLOC_TEST

Function Documentation

◆ __attribute__()

struct exactly_block __attribute__ ( (packed)  )

◆ check_if_empty_pool_is_empty()

static void check_if_empty_pool_is_empty ( )
static

◆ TEST_GROUP()

TEST_GROUP ( pool_unit  )
Here is the call graph for this function:

◆ test_alloc_dealloc_with_type()

template<typename T >
static void test_alloc_dealloc_with_type ( size_t  n,
size_t  blk_cnt 
)
static
Here is the call graph for this function:

◆ TEST() [1/5]

TEST ( pool_unit  ,
multiple_alloc_dealloc_of_block_type   
)

◆ TEST() [2/5]

TEST ( pool_unit  ,
too_big_allocation   
)
Here is the call graph for this function:

◆ TEST() [3/5]

TEST ( pool_unit  ,
depleted_pool   
)
Here is the call graph for this function:

◆ TEST() [4/5]

TEST ( pool_unit  ,
single_alloc_dealloc   
)

◆ TEST() [5/5]

TEST ( pool_unit  ,
randomly_allocate_and_deallocate   
)
Here is the call graph for this function:

Variable Documentation

◆ block_size

constexpr auto block_size = 16
static

◆ blocks

constexpr auto blocks = 100
static

◆ test_pool

ecl::pool_base* test_pool
static

◆ real_pool

ecl::pool< block_size, blocks >* real_pool
static

◆ data

char data