Tests for a AVP manipulation and search API.
More...
#include "acutest_common_init.h"
#include "acutest_helpers.h"
#include "pair_test_helpers.h"
#include <freeradius-devel/util/conf.h>
#include <freeradius-devel/util/dict.h>
#include <freeradius-devel/util/sbuff.h>
Go to the source code of this file.
|
| #define | TEST_PRINT_PAIR(_func, _parent, _vp, _expected) |
| | Print one pair into a buffer, and compare it against what we expect.
|
| |
| #define | USE_CONSTRUCTOR |
| | The 'TEST_INIT' macro provided by 'acutest.h' allowing to register a function to be called before call the unit tests.
|
| |
Tests for a AVP manipulation and search API.
- Author
- Jorge Pereira jpere.nosp@m.ira@.nosp@m.freer.nosp@m.adiu.nosp@m.s.org
- Copyright
- 2020 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file pair_tests.c.
◆ TEST_PRINT_PAIR
| #define TEST_PRINT_PAIR |
( |
|
_func, |
|
|
|
_parent, |
|
|
|
_vp, |
|
|
|
_expected |
|
) |
| |
Value:do { \
\
slen = _func(&sbuff, _parent, _vp); \
TEST_CHECK(slen > 0); \
TEST_MSG(#_func
" returned %zd: %s", slen,
fr_strerror()); \
\
TEST_CHECK(strcmp(
buffer, _expected) == 0); \
TEST_MSG("expected: %s", _expected); \
TEST_MSG(
"got : %s",
buffer); \
} while (0)
static int const char char buffer[256]
#define FR_SBUFF_OUT(_start, _len_or_end)
char const * fr_strerror(void)
Get the last library error.
Print one pair into a buffer, and compare it against what we expect.
Definition at line 1334 of file pair_tests.c.
◆ USE_CONSTRUCTOR
The 'TEST_INIT' macro provided by 'acutest.h' allowing to register 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 test_init() by "__attribute__((constructor));" reducing the test execution by 50% of the time.
Definition at line 30 of file pair_tests.c.
◆ dict_protocol_add()
Add a protocol to the global protocol table.
Inserts a protocol into the global protocol table. Uses the root attributes of the dictionary for comparisons.
- Parameters
-
| [in] | dict | of protocol we're inserting. |
- Returns
- 0 on success.
- -1 on failure.
Definition at line 1564 of file dict_util.c.
◆ test_fr_dict_by_protocol_substr_no_overflow()
| static void test_fr_dict_by_protocol_substr_no_overflow |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_afrom_child_num()
| static void test_fr_pair_afrom_child_num |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_afrom_da()
| static void test_fr_pair_afrom_da |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_afrom_da_nested()
| static void test_fr_pair_afrom_da_nested |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_append()
| static void test_fr_pair_append |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_append_by_da_parent()
| static void test_fr_pair_append_by_da_parent |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_cmp()
| static void test_fr_pair_cmp |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_copy()
| static void test_fr_pair_copy |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_dcursor_by_ancestor_init()
| static void test_fr_pair_dcursor_by_ancestor_init |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_dcursor_by_da_init()
| static void test_fr_pair_dcursor_by_da_init |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_dcursor_value_init()
| static void test_fr_pair_dcursor_value_init |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_debug()
| static void test_fr_pair_debug |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_delete()
| static void test_fr_pair_delete |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_delete_by_child_num()
| static void test_fr_pair_delete_by_child_num |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_delete_by_da()
| static void test_fr_pair_delete_by_da |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_delete_by_da_nested()
| static void test_fr_pair_delete_by_da_nested |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_find_by_child_num_idx()
| static void test_fr_pair_find_by_child_num_idx |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_find_by_da_idx()
| static void test_fr_pair_find_by_da_idx |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_find_by_da_nested()
| static void test_fr_pair_find_by_da_nested |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_list_cmp()
| static void test_fr_pair_list_cmp |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_list_copy()
| static void test_fr_pair_list_copy |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_list_copy_by_ancestor()
| static void test_fr_pair_list_copy_by_ancestor |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_list_copy_by_da()
| static void test_fr_pair_list_copy_by_da |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_list_print()
| static void test_fr_pair_list_print |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_list_sort()
| static void test_fr_pair_list_sort |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_nested_verify()
| static void test_fr_pair_nested_verify |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_prepend_by_da()
| static void test_fr_pair_prepend_by_da |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_print()
| static void test_fr_pair_print |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_print_name()
| static void test_fr_pair_print_name |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_print_secure()
| static void test_fr_pair_print_secure |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_print_secure_children()
| static void test_fr_pair_print_secure_children |
( |
void |
| ) |
|
|
static |
fr_pair_print_secure() walks the children of a structural pair
Each child but the last is followed by a separator, so the interesting cases are no children, one child, and more than one.
Definition at line 1445 of file pair_tests.c.
◆ test_fr_pair_print_value_quoted()
| static void test_fr_pair_print_value_quoted |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_raw_afrom_pair()
| static void test_fr_pair_raw_afrom_pair |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_steal()
| static void test_fr_pair_steal |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_update_by_da_parent()
| static void test_fr_pair_update_by_da_parent |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_aprintf()
| static void test_fr_pair_value_aprintf |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_bstr_alloc()
| static void test_fr_pair_value_bstr_alloc |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_bstr_realloc()
| static void test_fr_pair_value_bstr_realloc |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_bstrdup_buffer()
| static void test_fr_pair_value_bstrdup_buffer |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_bstrdup_buffer_shallow()
| static void test_fr_pair_value_bstrdup_buffer_shallow |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_bstrndup()
| static void test_fr_pair_value_bstrndup |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_bstrndup_shallow()
| static void test_fr_pair_value_bstrndup_shallow |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_copy()
| static void test_fr_pair_value_copy |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_enum()
| static void test_fr_pair_value_enum |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_enum_box()
| static void test_fr_pair_value_enum_box |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_from_str()
| static void test_fr_pair_value_from_str |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_mem_alloc()
| static void test_fr_pair_value_mem_alloc |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_mem_realloc()
| static void test_fr_pair_value_mem_realloc |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_memdup()
| static void test_fr_pair_value_memdup |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_memdup_buffer()
| static void test_fr_pair_value_memdup_buffer |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_memdup_buffer_shallow()
| static void test_fr_pair_value_memdup_buffer_shallow |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_memdup_shallow()
| static void test_fr_pair_value_memdup_shallow |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_strdup()
| static void test_fr_pair_value_strdup |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_strdup_shallow()
| static void test_fr_pair_value_strdup_shallow |
( |
void |
| ) |
|
|
static |
◆ test_fr_pair_value_strtrim()
| static void test_fr_pair_value_strtrim |
( |
void |
| ) |
|
|
static |
◆ test_init()
| static void test_init |
( |
void |
| ) |
|
|
static |
◆ TEST_LIST