Performance tests for lists of fr_pair_t.
More...
#include <freeradius-devel/util/acutest.h>
#include <freeradius-devel/util/dict_test.h>
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/rand.h>
#include <freeradius-devel/util/pair.h>
#include <freeradius-devel/util/pair_legacy.h>
Go to the source code of this file.
|
| all_test_funcs (fr_pair_append) |
|
static void | do_test_find_nth (unsigned int len, unsigned int perc, unsigned int reps, fr_pair_t *source_vps[]) |
|
static void | do_test_fr_pair_append (unsigned int len, unsigned int perc, unsigned int reps, fr_pair_t *source_vps[]) |
|
static void | do_test_fr_pair_find_by_da_idx (unsigned int len, unsigned int perc, unsigned int reps, fr_pair_t *source_vps[]) |
|
static void | do_test_fr_pair_list_free (unsigned int len, unsigned int perc, unsigned int reps, fr_pair_t *source_vps[]) |
|
static void | pair_list_perf_init (void) |
|
◆ all_repetition_tests
#define all_repetition_tests |
( |
|
_func | ) |
|
Value:
repetition_tests(_func, 25) \
repetition_tests(_func, 50) \
repetition_tests(_func, 75) \
repetition_tests(_func, 100)
#define repetition_tests(_func, _perc)
◆ all_test_funcs
#define all_test_funcs |
( |
|
_func | ) |
|
Value:
test_funcs(_func, 25) \
test_funcs(_func, 50) \
test_funcs(_func, 75) \
test_funcs(_func, 100)
#define test_funcs(_func, _perc)
Definition at line 499 of file pair_list_perf_test.c.
◆ repetition_tests
#define repetition_tests |
( |
|
_func, |
|
|
|
_perc |
|
) |
| |
Value: { #_func "_20_" #_perc, test_ ## _func ## _20_ ## _perc},\
{ #_func "_40_" #_perc, test_ ## _func ## _40_ ## _perc},\
{ #_func "_60_" #_perc, test_ ## _func ## _60_ ## _perc},\
{ #_func "_80_" #_perc, test_ ## _func ## _80_ ## _perc},\
{ #_func "_100_" #_perc, test_ ## _func ## _100_ ## _perc},\
◆ test_func
#define test_func |
( |
|
_func, |
|
|
|
_count, |
|
|
|
_perc, |
|
|
|
_source_vps |
|
) |
| |
Value:static void test_ ## _func ## _ ## _count ## _ ## _perc(void)\
{\
do_test_ ## _func(_count, _perc, 10000, _source_vps);\
}
Definition at line 486 of file pair_list_perf_test.c.
◆ test_funcs
#define test_funcs |
( |
|
_func, |
|
|
|
_perc |
|
) |
| |
Value: test_func(_func, 20, _perc, source_vps_ ## _perc) \
test_func(_func, 40, _perc, source_vps_ ## _perc) \
test_func(_func, 60, _perc, source_vps_ ## _perc) \
test_func(_func, 80, _perc, source_vps_ ## _perc) \
test_func(_func, 100, _perc, source_vps_ ## _perc)
#define test_func(_func, _count, _perc, _source_vps)
Definition at line 492 of file pair_list_perf_test.c.
◆ USE_CONSTRUCTOR
The 'TEST_INIT' macro provided by 'acutest.h' allows registering a function to be called before call the unit tests.
Therefore, It calls the function ALL THE TIME causing an overhead. That is why we are initializing pair_list_perf_init() by "__attribute__((constructor));" reducing the test execution by 50% of the time.
Definition at line 31 of file pair_list_perf_test.c.
◆ all_test_funcs()
◆ do_test_find_nth()
static void do_test_find_nth |
( |
unsigned int |
len, |
|
|
unsigned int |
perc, |
|
|
unsigned int |
reps, |
|
|
fr_pair_t * |
source_vps[] |
|
) |
| |
|
static |
◆ do_test_fr_pair_append()
static void do_test_fr_pair_append |
( |
unsigned int |
len, |
|
|
unsigned int |
perc, |
|
|
unsigned int |
reps, |
|
|
fr_pair_t * |
source_vps[] |
|
) |
| |
|
static |
◆ do_test_fr_pair_find_by_da_idx()
static void do_test_fr_pair_find_by_da_idx |
( |
unsigned int |
len, |
|
|
unsigned int |
perc, |
|
|
unsigned int |
reps, |
|
|
fr_pair_t * |
source_vps[] |
|
) |
| |
|
static |
◆ do_test_fr_pair_list_free()
static void do_test_fr_pair_list_free |
( |
unsigned int |
len, |
|
|
unsigned int |
perc, |
|
|
unsigned int |
reps, |
|
|
fr_pair_t * |
source_vps[] |
|
) |
| |
|
static |
◆ pair_list_perf_init()
void pair_list_perf_init |
( |
void |
| ) |
|
|
static |