The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions | Variables
minmax_heap_tests.c File Reference
#include <freeradius-devel/util/acutest.h>
#include <freeradius-devel/util/heap.h>
#include <freeradius-devel/util/rand.h>
#include <freeradius-devel/util/time.h>
#include "minmax_heap.c"
+ Include dependency graph for minmax_heap_tests.c:

Go to the source code of this file.

Data Structures

struct  minmax_heap_thing
 

Macros

#define BURN_IN_OPS   (10000000)
 
#define MINMAX_HEAP_CYCLE_SIZE   (1600000)
 
#define MINMAX_HEAP_TEST_SIZE   (4096)
 
#define NVALUES   20
 

Functions

static minmax_heap_thingarray_pop (minmax_heap_thing **array, unsigned int count)
 
static void minmax_heap_burn_in (void)
 
static int8_t minmax_heap_cmp (void const *one, void const *two)
 
static bool minmax_heap_contains (fr_minmax_heap_t *hp, void *data)
 
static void minmax_heap_cycle (void)
 
static void minmax_heap_iter (void)
 
static void minmax_heap_test (int skip)
 
static void minmax_heap_test_basic (void)
 
static void minmax_heap_test_order (void)
 
static void minmax_heap_test_skip_0 (void)
 
static void minmax_heap_test_skip_10 (void)
 
static void minmax_heap_test_skip_2 (void)
 
static void populate_values (minmax_heap_thing values[], unsigned int len)
 
static void queue_cmp (unsigned int count)
 Benchmarks for minmax heaps vs heaps when used as queues. More...
 
static void queue_cmp_10 (void)
 
static void queue_cmp_100 (void)
 
static void queue_cmp_1000 (void)
 
static void queue_cmp_50 (void)
 
 talloc_free (hp)
 
 TEST_CHECK (total=190)
 

Variables

 TEST_LIST
 

Data Structure Documentation

◆ minmax_heap_thing

struct minmax_heap_thing

Definition at line 8 of file minmax_heap_tests.c.

Data Fields
unsigned int data
fr_minmax_heap_index_t idx
bool visited

Macro Definition Documentation

◆ BURN_IN_OPS

#define BURN_IN_OPS   (10000000)

Definition at line 219 of file minmax_heap_tests.c.

◆ MINMAX_HEAP_CYCLE_SIZE

#define MINMAX_HEAP_CYCLE_SIZE   (1600000)

Definition at line 274 of file minmax_heap_tests.c.

◆ MINMAX_HEAP_TEST_SIZE

#define MINMAX_HEAP_TEST_SIZE   (4096)

Definition at line 125 of file minmax_heap_tests.c.

◆ NVALUES

#define NVALUES   20

Definition at line 77 of file minmax_heap_tests.c.

Function Documentation

◆ array_pop()

static minmax_heap_thing* array_pop ( minmax_heap_thing **  array,
unsigned int  count 
)
static

Definition at line 353 of file minmax_heap_tests.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ minmax_heap_burn_in()

static void minmax_heap_burn_in ( void  )
static

Definition at line 221 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ minmax_heap_cmp()

static int8_t minmax_heap_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 23 of file minmax_heap_tests.c.

+ Here is the caller graph for this function:

◆ minmax_heap_contains()

static bool minmax_heap_contains ( fr_minmax_heap_t hp,
void *  data 
)
static

Definition at line 14 of file minmax_heap_tests.c.

+ Here is the caller graph for this function:

◆ minmax_heap_cycle()

static void minmax_heap_cycle ( void  )
static

Definition at line 513 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ minmax_heap_iter()

static void minmax_heap_iter ( void  )
static

Definition at line 600 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ minmax_heap_test()

static void minmax_heap_test ( int  skip)
static

Definition at line 127 of file minmax_heap_tests.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ minmax_heap_test_basic()

static void minmax_heap_test_basic ( void  )
static

Definition at line 78 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ minmax_heap_test_order()

static void minmax_heap_test_order ( void  )
static

Definition at line 276 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ minmax_heap_test_skip_0()

static void minmax_heap_test_skip_0 ( void  )
static

Definition at line 204 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ minmax_heap_test_skip_10()

static void minmax_heap_test_skip_10 ( void  )
static

Definition at line 214 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ minmax_heap_test_skip_2()

static void minmax_heap_test_skip_2 ( void  )
static

Definition at line 209 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ populate_values()

static void populate_values ( minmax_heap_thing  values[],
unsigned int  len 
)
static

Definition at line 53 of file minmax_heap_tests.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ queue_cmp()

static void queue_cmp ( unsigned int  count)
static

Benchmarks for minmax heaps vs heaps when used as queues.

Definition at line 374 of file minmax_heap_tests.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ queue_cmp_10()

static void queue_cmp_10 ( void  )
static

Definition at line 493 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ queue_cmp_100()

static void queue_cmp_100 ( void  )
static

Definition at line 503 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ queue_cmp_1000()

static void queue_cmp_1000 ( void  )
static

Definition at line 508 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ queue_cmp_50()

static void queue_cmp_50 ( void  )
static

Definition at line 498 of file minmax_heap_tests.c.

+ Here is the call graph for this function:

◆ talloc_free()

talloc_free ( hp  )
+ Here is the caller graph for this function:

◆ TEST_CHECK()

TEST_CHECK ( total  = 190)
+ Here is the caller graph for this function:

Variable Documentation

◆ TEST_LIST

TEST_LIST
Initial value:
= {
{ "minmax_heap_test_basic", minmax_heap_test_basic },
{ "minmax_heap_test_skip_0", minmax_heap_test_skip_0 },
{ "minmax_heap_test_skip_2", minmax_heap_test_skip_2 },
{ "minmax_heap_test_skip_10", minmax_heap_test_skip_10 },
{ "minmax_heap_test_order", minmax_heap_test_order },
{ "minmax_heap_burn_in", minmax_heap_burn_in },
{ "minmax_heap_cycle", minmax_heap_cycle },
{ "minmax_heap_iter", minmax_heap_iter },
{ "queue_cmp_10", queue_cmp_10 },
{ "queue_cmp_50", queue_cmp_50 },
{ "queue_cmp_100", queue_cmp_100 },
{ "queue_cmp_1000", queue_cmp_1000 },
{ NULL }
}
static void queue_cmp_100(void)
static void queue_cmp_50(void)
static void minmax_heap_test_order(void)
static void minmax_heap_test_skip_2(void)
static void minmax_heap_test_skip_0(void)
static void minmax_heap_cycle(void)
static void queue_cmp_1000(void)
static void queue_cmp_10(void)
static void minmax_heap_test_skip_10(void)
static void minmax_heap_test_basic(void)
static void minmax_heap_burn_in(void)
static void minmax_heap_iter(void)

Definition at line 634 of file minmax_heap_tests.c.