unbound 0.1
unitregional.c File Reference

Tests the regional special purpose allocator. More...

#include "config.h"
#include "testcode/unitmain.h"
#include "util/log.h"
#include "util/regional.h"

Functions

static void corner_cases (struct regional *r)
 test regional corner cases, zero, one, end of structure
static void specific_cases (void)
 test specific cases
static void burden_test (size_t max)
 put random stuff in a region and free it
static void random_burden (void)
 randomly allocate stuff
void regional_test (void)
 unit test for regional allocator functions

Detailed Description

Tests the regional special purpose allocator.

Function Documentation

◆ corner_cases()

◆ specific_cases()

◆ burden_test()

void burden_test ( size_t max)
static

put random stuff in a region and free it

References burden_test(), regional_alloc(), regional_create_custom(), regional_destroy(), regional_free_all(), and unit_assert.

Referenced by burden_test(), and random_burden().

◆ random_burden()

void random_burden ( void )
static

randomly allocate stuff

References burden_test(), and random_burden().

Referenced by random_burden(), and regional_test().

◆ regional_test()

void regional_test ( void )

unit test for regional allocator functions

References random_burden(), regional_test(), specific_cases(), and unit_show_feature().

Referenced by main(), and regional_test().