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

Go to the source code of this file.

Data Structures

struct  lst_thing
 

Macros

#define BURN_IN_OPS   (10000000)
 
#define LST_CYCLE_SIZE   (1600000)
 
#define LST_TEST_SIZE   (4096)
 
#define NVALUES   20
 

Functions

static lst_thingarray_pop (lst_thing **array, unsigned int count)
 
static bool fr_lst_contains (fr_lst_t *lst, void *data)
 
static void lst_burn_in (void)
 
static int8_t lst_cmp (void const *one, void const *two)
 
static void lst_cycle (void)
 
static void lst_iter (void)
 
static void lst_stress_realloc (void)
 
static void lst_test (int skip)
 
static void lst_test_basic (void)
 
static void lst_test_skip_1 (void)
 
static void lst_test_skip_10 (void)
 
static void lst_test_skip_2 (void)
 
static void populate_values (lst_thing values[], unsigned int len)
 
static void queue_cmp (unsigned int count)
 Benchmarks for LSTs 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 (lst)
 
 TEST_CHECK (total=190)
 

Variables

 TEST_LIST
 

Data Structure Documentation

◆ lst_thing

struct lst_thing

Definition at line 14 of file lst_tests.c.

Data Fields
unsigned int data
fr_lst_index_t idx
bool visited

Macro Definition Documentation

◆ BURN_IN_OPS

#define BURN_IN_OPS   (10000000)

Definition at line 241 of file lst_tests.c.

◆ LST_CYCLE_SIZE

#define LST_CYCLE_SIZE   (1600000)

Definition at line 288 of file lst_tests.c.

◆ LST_TEST_SIZE

#define LST_TEST_SIZE   (4096)

Definition at line 91 of file lst_tests.c.

◆ NVALUES

#define NVALUES   20

Definition at line 64 of file lst_tests.c.

Function Documentation

◆ array_pop()

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

Definition at line 404 of file lst_tests.c.

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

◆ fr_lst_contains()

static bool fr_lst_contains ( fr_lst_t lst,
void *  data 
)
static

Definition at line 24 of file lst_tests.c.

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

◆ lst_burn_in()

static void lst_burn_in ( void  )
static

Definition at line 243 of file lst_tests.c.

+ Here is the call graph for this function:

◆ lst_cmp()

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

Definition at line 33 of file lst_tests.c.

+ Here is the caller graph for this function:

◆ lst_cycle()

static void lst_cycle ( void  )
static

Definition at line 290 of file lst_tests.c.

+ Here is the call graph for this function:

◆ lst_iter()

static void lst_iter ( void  )
static

Definition at line 370 of file lst_tests.c.

+ Here is the call graph for this function:

◆ lst_stress_realloc()

static void lst_stress_realloc ( void  )
static

Definition at line 168 of file lst_tests.c.

+ Here is the call graph for this function:

◆ lst_test()

static void lst_test ( int  skip)
static

Definition at line 93 of file lst_tests.c.

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

◆ lst_test_basic()

static void lst_test_basic ( void  )
static

Definition at line 65 of file lst_tests.c.

+ Here is the call graph for this function:

◆ lst_test_skip_1()

static void lst_test_skip_1 ( void  )
static

Definition at line 152 of file lst_tests.c.

+ Here is the call graph for this function:

◆ lst_test_skip_10()

static void lst_test_skip_10 ( void  )
static

Definition at line 162 of file lst_tests.c.

+ Here is the call graph for this function:

◆ lst_test_skip_2()

static void lst_test_skip_2 ( void  )
static

Definition at line 157 of file lst_tests.c.

+ Here is the call graph for this function:

◆ populate_values()

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

Definition at line 40 of file lst_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 LSTs vs heaps when used as queues.

Definition at line 425 of file lst_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 545 of file lst_tests.c.

+ Here is the call graph for this function:

◆ queue_cmp_100()

static void queue_cmp_100 ( void  )
static

Definition at line 555 of file lst_tests.c.

+ Here is the call graph for this function:

◆ queue_cmp_1000()

static void queue_cmp_1000 ( void  )
static

Definition at line 560 of file lst_tests.c.

+ Here is the call graph for this function:

◆ queue_cmp_50()

static void queue_cmp_50 ( void  )
static

Definition at line 550 of file lst_tests.c.

+ Here is the call graph for this function:

◆ talloc_free()

talloc_free ( lst  )
+ 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:
= {
{ "lst_test_basic", lst_test_basic },
{ "lst_test_skip_1", lst_test_skip_1 },
{ "lst_test_skip_2", lst_test_skip_2 },
{ "lst_test_skip_10", lst_test_skip_10 },
{ "lst_stress_realloc", lst_stress_realloc },
{ "lst_burn_in", lst_burn_in },
{ "lst_cycle", lst_cycle },
{ "lst_iter", lst_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)
Definition: lst_tests.c:555
static void lst_test_skip_10(void)
Definition: lst_tests.c:162
static void queue_cmp_50(void)
Definition: lst_tests.c:550
static void lst_cycle(void)
Definition: lst_tests.c:290
static void lst_burn_in(void)
Definition: lst_tests.c:243
static void lst_test_basic(void)
Definition: lst_tests.c:65
static void lst_iter(void)
Definition: lst_tests.c:370
static void queue_cmp_1000(void)
Definition: lst_tests.c:560
static void lst_test_skip_2(void)
Definition: lst_tests.c:157
static void queue_cmp_10(void)
Definition: lst_tests.c:545
static void lst_test_skip_1(void)
Definition: lst_tests.c:152
static void lst_stress_realloc(void)
Definition: lst_tests.c:168

Definition at line 565 of file lst_tests.c.