The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
Macros | Functions | Variables
pair_nested_tests.c File Reference
#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>
+ Include dependency graph for pair_nested_tests.c:

Go to the source code of this file.

Macros

#define TEST_GLOBAL_INIT   test_init()
 
#define TEST_PRINT_PAIR(_func, _parent, _vp, _expected)
 Print one pair into a buffer, and compare it against what we expect.
 

Functions

int dict_protocol_add (fr_dict_t *dict)
 Add a protocol to the global protocol table.
 
static void test_fr_dict_by_protocol_substr_no_overflow (void)
 
static void test_fr_pair_afrom_child_num (void)
 
static void test_fr_pair_afrom_da (void)
 
static void test_fr_pair_afrom_da_nested (void)
 
static void test_fr_pair_append (void)
 
static void test_fr_pair_append_by_da_parent (void)
 
static void test_fr_pair_cmp (void)
 
static void test_fr_pair_copy (void)
 
static void test_fr_pair_dcursor_by_ancestor_init (void)
 
static void test_fr_pair_dcursor_by_da_init (void)
 
static void test_fr_pair_dcursor_value_init (void)
 
static void test_fr_pair_debug (void)
 fr_pair_debug() and fr_pair_list_debug() write to a FILE, not to an sbuff
 
static void test_fr_pair_delete (void)
 
static void test_fr_pair_delete_by_child_num (void)
 
static void test_fr_pair_delete_by_da (void)
 
static void test_fr_pair_delete_by_da_nested (void)
 
static void test_fr_pair_find_by_child_num_idx (void)
 
static void test_fr_pair_find_by_da_idx (void)
 
static void test_fr_pair_find_by_da_nested (void)
 
static void test_fr_pair_list_cmp (void)
 
static void test_fr_pair_list_copy (void)
 
static void test_fr_pair_list_copy_by_ancestor (void)
 
static void test_fr_pair_list_copy_by_da (void)
 
static void test_fr_pair_list_print (void)
 
static void test_fr_pair_list_sort (void)
 
static void test_fr_pair_nested_verify (void)
 
static void test_fr_pair_prepend_by_da (void)
 
static void test_fr_pair_print (void)
 
static void test_fr_pair_print_name (void)
 
static void test_fr_pair_print_secure (void)
 
static void test_fr_pair_print_secure_children (void)
 fr_pair_print_secure() walks the children of a structural pair
 
static void test_fr_pair_print_value_quoted (void)
 
static void test_fr_pair_raw_afrom_pair (void)
 
static void test_fr_pair_steal (void)
 
static void test_fr_pair_update_by_da_parent (void)
 
static void test_fr_pair_value_aprintf (void)
 
static void test_fr_pair_value_bstr_alloc (void)
 
static void test_fr_pair_value_bstr_realloc (void)
 
static void test_fr_pair_value_bstrdup_buffer (void)
 
static void test_fr_pair_value_bstrdup_buffer_shallow (void)
 
static void test_fr_pair_value_bstrndup (void)
 
static void test_fr_pair_value_bstrndup_shallow (void)
 
static void test_fr_pair_value_copy (void)
 
static void test_fr_pair_value_enum (void)
 
static void test_fr_pair_value_enum_box (void)
 
static void test_fr_pair_value_from_str (void)
 
static void test_fr_pair_value_mem_alloc (void)
 
static void test_fr_pair_value_mem_realloc (void)
 
static void test_fr_pair_value_memdup (void)
 
static void test_fr_pair_value_memdup_buffer (void)
 
static void test_fr_pair_value_memdup_buffer_shallow (void)
 
static void test_fr_pair_value_memdup_shallow (void)
 
static void test_fr_pair_value_strdup (void)
 
static void test_fr_pair_value_strdup_shallow (void)
 
static void test_fr_pair_value_strtrim (void)
 
static void test_init (void)
 Global initialisation.
 

Variables

static TALLOC_CTX * autofree
 
static fr_dict_t * test_dict
 
 TEST_LIST
 
static fr_pair_list_t test_pairs
 

Macro Definition Documentation

◆ TEST_GLOBAL_INIT

#define TEST_GLOBAL_INIT   test_init()

Definition at line 25 of file pair_nested_tests.c.

◆ TEST_PRINT_PAIR

#define TEST_PRINT_PAIR (   _func,
  _parent,
  _vp,
  _expected 
)
Value:
do { \
char buffer[1024]; \
fr_sbuff_t sbuff = FR_SBUFF_OUT(buffer, sizeof(buffer)); \
ssize_t slen; \
\
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]
Definition acutest.h:641
long int ssize_t
#define FR_SBUFF_OUT(_start, _len_or_end)
char const * fr_strerror(void)
Get the last library error.
Definition strerror.c:558

Print one pair into a buffer, and compare it against what we expect.

Definition at line 1319 of file pair_nested_tests.c.

Function Documentation

◆ dict_protocol_add()

int dict_protocol_add ( fr_dict_t *  dict)
extern

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]dictof protocol we're inserting.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 1561 of file dict_util.c.

+ Here is the caller graph for this function:

◆ test_fr_dict_by_protocol_substr_no_overflow()

static void test_fr_dict_by_protocol_substr_no_overflow ( void  )
static

Definition at line 1288 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_afrom_child_num()

static void test_fr_pair_afrom_child_num ( void  )
static

Definition at line 95 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_afrom_da()

static void test_fr_pair_afrom_da ( void  )
static

Definition at line 74 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_afrom_da_nested()

static void test_fr_pair_afrom_da_nested ( void  )
static

Definition at line 112 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_append()

static void test_fr_pair_append ( void  )
static

Definition at line 457 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_append_by_da_parent()

static void test_fr_pair_append_by_da_parent ( void  )
static

Definition at line 483 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_cmp()

static void test_fr_pair_cmp ( void  )
static

Definition at line 615 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_copy()

static void test_fr_pair_copy ( void  )
static

Definition at line 175 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_dcursor_by_ancestor_init()

static void test_fr_pair_dcursor_by_ancestor_init ( void  )
static

Definition at line 261 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_dcursor_by_da_init()

static void test_fr_pair_dcursor_by_da_init ( void  )
static

Definition at line 235 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_dcursor_value_init()

static void test_fr_pair_dcursor_value_init ( void  )
static

Definition at line 287 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_debug()

static void test_fr_pair_debug ( void  )
static

fr_pair_debug() and fr_pair_list_debug() write to a FILE, not to an sbuff

Definition at line 1492 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_delete()

static void test_fr_pair_delete ( void  )
static

Definition at line 600 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_delete_by_child_num()

static void test_fr_pair_delete_by_child_num ( void  )
static

Definition at line 534 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_delete_by_da()

static void test_fr_pair_delete_by_da ( void  )
static

Definition at line 588 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_delete_by_da_nested()

static void test_fr_pair_delete_by_da_nested ( void  )
static

Definition at line 141 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_find_by_child_num_idx()

static void test_fr_pair_find_by_child_num_idx ( void  )
static

Definition at line 356 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_find_by_da_idx()

static void test_fr_pair_find_by_da_idx ( void  )
static

Definition at line 342 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_find_by_da_nested()

static void test_fr_pair_find_by_da_nested ( void  )
static

Definition at line 370 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_list_cmp()

static void test_fr_pair_list_cmp ( void  )
static

Definition at line 641 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_list_copy()

static void test_fr_pair_list_copy ( void  )
static

Definition at line 661 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_list_copy_by_ancestor()

static void test_fr_pair_list_copy_by_ancestor ( void  )
static

Definition at line 697 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_list_copy_by_da()

static void test_fr_pair_list_copy_by_da ( void  )
static

Definition at line 676 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_list_print()

static void test_fr_pair_list_print ( void  )
static

Definition at line 1461 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_list_sort()

static void test_fr_pair_list_sort ( void  )
static

Definition at line 734 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_nested_verify()

static void test_fr_pair_nested_verify ( void  )
static

Definition at line 168 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_prepend_by_da()

static void test_fr_pair_prepend_by_da ( void  )
static

Definition at line 546 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_print()

static void test_fr_pair_print ( void  )
static

Definition at line 1334 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_print_name()

static void test_fr_pair_print_name ( void  )
static

Definition at line 1351 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_print_secure()

static void test_fr_pair_print_secure ( void  )
static

Definition at line 1407 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ 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 1430 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_print_value_quoted()

static void test_fr_pair_print_value_quoted ( void  )
static

Definition at line 1383 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_raw_afrom_pair()

static void test_fr_pair_raw_afrom_pair ( void  )
static

Definition at line 217 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_steal()

static void test_fr_pair_steal ( void  )
static

Definition at line 199 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_update_by_da_parent()

static void test_fr_pair_update_by_da_parent ( void  )
static

Definition at line 565 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_aprintf()

static void test_fr_pair_value_aprintf ( void  )
static

Definition at line 903 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_bstr_alloc()

static void test_fr_pair_value_bstr_alloc ( void  )
static

Definition at line 927 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_bstr_realloc()

static void test_fr_pair_value_bstr_realloc ( void  )
static

Definition at line 954 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_bstrdup_buffer()

static void test_fr_pair_value_bstrdup_buffer ( void  )
static

Definition at line 1001 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_bstrdup_buffer_shallow()

static void test_fr_pair_value_bstrdup_buffer_shallow ( void  )
static

Definition at line 1047 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_bstrndup()

static void test_fr_pair_value_bstrndup ( void  )
static

Definition at line 984 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_bstrndup_shallow()

static void test_fr_pair_value_bstrndup_shallow ( void  )
static

Definition at line 1024 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_copy()

static void test_fr_pair_value_copy ( void  )
static

Definition at line 785 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_enum()

static void test_fr_pair_value_enum ( void  )
static

Definition at line 1218 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_enum_box()

static void test_fr_pair_value_enum_box ( void  )
static

Definition at line 1241 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_from_str()

static void test_fr_pair_value_from_str ( void  )
static

Definition at line 812 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_mem_alloc()

static void test_fr_pair_value_mem_alloc ( void  )
static

Definition at line 1070 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_mem_realloc()

static void test_fr_pair_value_mem_realloc ( void  )
static

Definition at line 1094 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_memdup()

static void test_fr_pair_value_memdup ( void  )
static

Definition at line 1132 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_memdup_buffer()

static void test_fr_pair_value_memdup_buffer ( void  )
static

Definition at line 1149 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_memdup_buffer_shallow()

static void test_fr_pair_value_memdup_buffer_shallow ( void  )
static

Definition at line 1195 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_memdup_shallow()

static void test_fr_pair_value_memdup_shallow ( void  )
static

Definition at line 1172 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_strdup()

static void test_fr_pair_value_strdup ( void  )
static

Definition at line 832 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_strdup_shallow()

static void test_fr_pair_value_strdup_shallow ( void  )
static

Definition at line 852 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_fr_pair_value_strtrim()

static void test_fr_pair_value_strtrim ( void  )
static

Definition at line 880 of file pair_nested_tests.c.

+ Here is the call graph for this function:

◆ test_init()

static void test_init ( void  )
static

Global initialisation.

Definition at line 41 of file pair_nested_tests.c.

+ Here is the call graph for this function:

Variable Documentation

◆ autofree

TALLOC_CTX* autofree
static

Definition at line 35 of file pair_nested_tests.c.

◆ test_dict

fr_dict_t* test_dict
static

Definition at line 37 of file pair_nested_tests.c.

◆ TEST_LIST

TEST_LIST

Definition at line 1530 of file pair_nested_tests.c.

◆ test_pairs

fr_pair_list_t test_pairs
static

Definition at line 36 of file pair_nested_tests.c.