![]() |
The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
|
Tests for timer lists. More...
#include "acutest_common_init.h"#include "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 |
| struct | disarm_ctx_t |
| A callback which disarms the list which the callback runs in. More... | |
| struct | free_ctx_t |
| A callback which frees the list which the callback runs in, or the talloc parent of the list. More... | |
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 | disarm_test (fr_timer_list_t *tl_outer, fr_timer_list_t *tl_inner) |
| A callback which disarms the list stops the rest of the run. | |
| static int | free_ctx_probe_destructor (UNUSED void *probe) |
| static void | free_in_callback_test (bool ordered, bool free_parent) |
| A callback may free the list which the callback runs in, or the talloc parent of the list. | |
| static void | lst_basic_test (void) |
| static void | lst_deferred_test (void) |
| static void | lst_disarm_in_callback (void) |
| static void | lst_free_list_in_callback (void) |
| static void | lst_free_parent_in_callback (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_disarm_in_callback (void) |
| static void | ordered_free_list_in_callback (void) |
| static void | ordered_free_parent_in_callback (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) |
| static void | timer_cb_disarm (UNUSED fr_timer_list_t *tl, UNUSED fr_time_t now, void *uctx) |
| static void | timer_cb_free (UNUSED fr_timer_list_t *tl, UNUSED fr_time_t now, void *uctx) |
Variables | |
| static bool | free_probe_destroyed |
| TEST_LIST | |
Tests for timer lists.
Definition in file timer_tests.c.
| struct deferred_uctx_t |
Definition at line 173 of file timer_tests.c.
Collaboration diagram for deferred_uctx_t:| Data Fields | ||
|---|---|---|
| fr_timer_t * | event | |
| bool * | fired | |
| struct disarm_ctx_t |
A callback which disarms the list which the callback runs in.
Definition at line 392 of file timer_tests.c.
Collaboration diagram for disarm_ctx_t:| Data Fields | ||
|---|---|---|
| bool | fired | |
| fr_timer_list_t * | tl | list to disarm |
| struct free_ctx_t |
A callback which frees the list which the callback runs in, or the talloc parent of the list.
Freeing the talloc parent is the shape of a module which allocates a child list with a connection handle as the talloc parent, and then closes the connection, and so frees the handle, from a timer callback.
Definition at line 475 of file timer_tests.c.
Collaboration diagram for free_ctx_t:| Data Fields | ||
|---|---|---|
| fr_timer_t * | deferred | event which the callback inserts. |
| bool | fired | |
| fr_timer_t * | pending | event in the list, due after the callback. |
| int | ret | Result of talloc_free(). |
| fr_timer_list_t * | tl | list which runs the callback. |
| void * | to_free | what the callback frees. |
| #define TIME_SOURCE | ( | _name | ) |
Defines an artificial time source for a test.
Defines _name + _time() and _name + _set() functions.
Definition at line 32 of file timer_tests.c.
|
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:
|
static |
Definition at line 188 of file timer_tests.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
A callback which disarms the list stops the rest of the run.
Arming the list runs the rest.
Definition at line 407 of file timer_tests.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
A callback may free the list which the callback runs in, or the talloc parent of the list.
The code which runs the callbacks must not read the list after the callback returns. The test checks that the list is freed, that the list frees the events which are pending and deferred, and that the run returns. An address sanitiser reports a read of the list after the callback.
Definition at line 512 of file timer_tests.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 274 of file timer_tests.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
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:
|
static |
Definition at line 178 of file timer_tests.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 397 of file timer_tests.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 492 of file timer_tests.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 484 of file timer_tests.c.
| TEST_LIST |
Definition at line 595 of file timer_tests.c.
1.9.8