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

Tests for a AVP manipulation and search API. More...

#include "acutest.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_tests.c:

Go to the source code of this file.

Macros

#define USE_CONSTRUCTOR
 The 'TEST_INIT' macro provided by 'acutest.h' allowing to register a function to be called before call the unit tests.
 

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_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_sort (void)
 
static void test_fr_pair_nested_verify (void)
 
static void test_fr_pair_prepend_by_da (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

 TEST_LIST
 

Detailed Description

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

Definition in file pair_tests.c.

Macro Definition Documentation

◆ USE_CONSTRUCTOR

#define 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.

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 1487 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 1322 of file pair_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 110 of file pair_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 89 of file pair_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 127 of file pair_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 480 of file pair_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 509 of file pair_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 645 of file pair_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 190 of file pair_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 276 of file pair_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 250 of file pair_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 302 of file pair_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 630 of file pair_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 560 of file pair_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 618 of file pair_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 156 of file pair_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 371 of file pair_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 357 of file pair_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 385 of file pair_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 671 of file pair_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 691 of file pair_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 731 of file pair_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 706 of file pair_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 768 of file pair_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 183 of file pair_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 572 of file pair_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 232 of file pair_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 214 of file pair_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 595 of file pair_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 937 of file pair_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 961 of file pair_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 988 of file pair_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 1035 of file pair_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 1081 of file pair_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 1018 of file pair_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 1058 of file pair_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 819 of file pair_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 1252 of file pair_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 1275 of file pair_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 846 of file pair_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 1104 of file pair_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 1128 of file pair_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 1166 of file pair_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 1183 of file pair_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 1229 of file pair_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 1206 of file pair_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 866 of file pair_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 886 of file pair_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 914 of file pair_tests.c.

+ Here is the call graph for this function:

◆ test_init()

static void test_init ( void  )
static

Global initialisation.

Definition at line 36 of file pair_tests.c.

Variable Documentation

◆ TEST_LIST

TEST_LIST

Definition at line 1346 of file pair_tests.c.