The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
timer_tests.c File Reference

Tests for timer lists. More...

#include <freeradius-devel/util/acutest.h>
#include <freeradius-devel/util/acutest_helpers.h>
#include <freeradius-devel/util/time.h>
#include <freeradius-devel/util/timer.h>
+ Include dependency graph for timer_tests.c:

Go to the source code of this file.

Data Structures

struct  deferred_uctx_t
 

Macros

#define TIME_SOURCE(_name)
 Defines an artificial time source for a test.
 

Functions

static void basic_timer_list_tests (fr_timer_list_t *tl)
 
static void deferred_timer_list_tests (fr_timer_list_t *tl)
 
static void lst_basic_test (void)
 
static void lst_deferred_test (void)
 
static void lst_nested (void)
 
static void nested_test (fr_timer_list_t *tl_outer, fr_timer_list_t *tl_inner)
 
static void ordered_bad_inserts_test (void)
 
static void ordered_basic_test (void)
 
static void ordered_deferred_test (void)
 
static void ordered_nested (void)
 
static void timer_cb (fr_timer_list_t *tl, fr_time_t now, void *uctx)
 Verifies time passed in is not 0, that tl is not NULL, and writes true to uctx (must be a bool)
 
static void timer_cb_deferred (fr_timer_list_t *tl, fr_time_t now, void *uctx)
 

Variables

 TEST_LIST
 

Detailed Description

Tests for timer lists.

Definition in file timer_tests.c.


Data Structure Documentation

◆ deferred_uctx_t

struct deferred_uctx_t

Definition at line 174 of file timer_tests.c.

+ Collaboration diagram for deferred_uctx_t:
Data Fields
fr_timer_t * event
bool * fired

Macro Definition Documentation

◆ TIME_SOURCE

#define TIME_SOURCE (   _name)
Value:
static fr_time_t _name##_timer = fr_time_wrap(0); \
static fr_time_t _name##_time(void) \
{ \
return _name##_timer; \
} \
static void _name##_set(fr_time_t t) \
{ \
_name##_timer = t; \
}
#define fr_time_wrap(_time)
Definition time.h:145
"server local" time.
Definition time.h:69

Defines an artificial time source for a test.

Defines _name + _time() and _name + _set() functions.

Definition at line 32 of file timer_tests.c.

Function Documentation

◆ basic_timer_list_tests()

static void basic_timer_list_tests ( fr_timer_list_t tl)
static

Definition at line 58 of file timer_tests.c.

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

◆ deferred_timer_list_tests()

static void deferred_timer_list_tests ( fr_timer_list_t tl)
static

Definition at line 189 of file timer_tests.c.

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

◆ lst_basic_test()

static void lst_basic_test ( void  )
static

Definition at line 159 of file timer_tests.c.

+ Here is the call graph for this function:

◆ lst_deferred_test()

static void lst_deferred_test ( void  )
static

Definition at line 228 of file timer_tests.c.

+ Here is the call graph for this function:

◆ lst_nested()

static void lst_nested ( void  )
static

Definition at line 333 of file timer_tests.c.

+ Here is the call graph for this function:

◆ nested_test()

static void nested_test ( fr_timer_list_t tl_outer,
fr_timer_list_t tl_inner 
)
static

Definition at line 279 of file timer_tests.c.

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

◆ ordered_bad_inserts_test()

static void ordered_bad_inserts_test ( void  )
static

Definition at line 254 of file timer_tests.c.

+ Here is the call graph for this function:

◆ ordered_basic_test()

static void ordered_basic_test ( void  )
static

Definition at line 213 of file timer_tests.c.

+ Here is the call graph for this function:

◆ ordered_deferred_test()

static void ordered_deferred_test ( void  )
static

Definition at line 241 of file timer_tests.c.

+ Here is the call graph for this function:

◆ ordered_nested()

static void ordered_nested ( void  )
static

Definition at line 366 of file timer_tests.c.

+ Here is the call graph for this function:

◆ timer_cb()

static void timer_cb ( fr_timer_list_t tl,
fr_time_t  now,
void *  uctx 
)
static

Verifies time passed in is not 0, that tl is not NULL, and writes true to uctx (must be a bool)

Definition at line 48 of file timer_tests.c.

+ Here is the caller graph for this function:

◆ timer_cb_deferred()

static void timer_cb_deferred ( fr_timer_list_t tl,
fr_time_t  now,
void *  uctx 
)
static

Definition at line 179 of file timer_tests.c.

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

Variable Documentation

◆ TEST_LIST

TEST_LIST
Initial value:
= {
{ "lst_basic", lst_basic_test },
{ "ordered_basic", ordered_basic_test },
{ "lst_deferred", lst_deferred_test },
{ "ordered_deferred", ordered_deferred_test },
{ "ordered_bad_inserts", ordered_bad_inserts_test },
{ "lst_nested", lst_nested },
{ "ordered_nested", ordered_nested },
{ NULL }
}
static void ordered_nested(void)
static void lst_nested(void)
static void ordered_basic_test(void)
static void lst_basic_test(void)
static void ordered_deferred_test(void)
static void lst_deferred_test(void)
static void ordered_bad_inserts_test(void)

Definition at line 399 of file timer_tests.c.