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

Tests for tmpl parsing and printing. More...

#include <freeradius-devel/util/test/acutest.h>
#include <freeradius-devel/util/test/acutest_helpers.h>
#include <freeradius-devel/util/dict_test.h>
#include <freeradius-devel/server/tmpl.h>
#include <freeradius-devel/server/tmpl_dcursor.h>
#include <freeradius-devel/server/pair.h>
+ Include dependency graph for tmpl_tests.c:

Go to the source code of this file.

Macros

#define TEST_INIT   test_init()
 
#define test_rules()
 Default tmpl rules for tests.
 

Functions

static request_trequest_fake_alloc (void)
 
static void test_cast_invalid (void)
 
static void test_cast_uint32_to_uint64 (void)
 
static void test_cast_unresolved_to_string (void)
 
static void test_cast_unresolved_to_uint32 (void)
 
static void test_copy_attr (void)
 
static void test_copy_data (void)
 
static void test_copy_data_unresolved (void)
 
static void test_eval_attr_count (void)
 
static void test_eval_attr_found (void)
 
static void test_eval_attr_missing (void)
 
static void test_eval_attr_multiple (void)
 
static void test_eval_data (void)
 
static void test_find_or_add_existing (void)
 
static void test_find_or_add_new (void)
 
static void test_find_vp_found (void)
 
static void test_find_vp_missing (void)
 
static void test_from_value_box_ipaddr (void)
 
static void test_from_value_box_string (void)
 
static void test_from_value_box_uint32 (void)
 
static void test_init (void)
 Global initialisation.
 
static void test_parse_attr_all (void)
 
static void test_parse_attr_count (void)
 
static void test_parse_attr_empty_ref (void)
 
static void test_parse_attr_emptystring (void)
 
static void test_parse_attr_index (void)
 
static void test_parse_attr_invalid (void)
 
static void test_parse_attr_last (void)
 
static void test_parse_attr_missing (void)
 
static void test_parse_attr_nested (void)
 
static void test_parse_attr_simple (void)
 
static void test_parse_attr_unresolved_disallowed (void)
 
static void test_parse_bareword_attr (void)
 
static void test_parse_double_quoted_literal (void)
 
static void test_parse_double_quoted_xlat (void)
 
static void test_parse_single_quoted (void)
 
static void test_print_attr (void)
 
static void test_print_data_string (void)
 
static void test_print_data_uint32 (void)
 
static void test_print_quoted (void)
 
static void test_type_checking (void)
 

Variables

static TALLOC_CTX * autofree
 
static fr_dict_ttest_dict
 
 TEST_LIST
 

Detailed Description

Tests for tmpl parsing and printing.

Definition in file tmpl_tests.c.

Macro Definition Documentation

◆ TEST_INIT

#define TEST_INIT   test_init()

Definition at line 25 of file tmpl_tests.c.

◆ test_rules

#define test_rules ( )
Value:
(&(tmpl_rules_t){ \
.attr = { \
.dict_def = test_dict, \
.list_def = request_attr_request, \
} \
})
fr_dict_attr_t const * request_attr_request
Definition request.c:43
struct tmpl_rules_s tmpl_rules_t
Definition tmpl.h:233
static fr_dict_t * test_dict
Definition tmpl_tests.c:35

Default tmpl rules for tests.

Definition at line 80 of file tmpl_tests.c.

Function Documentation

◆ request_fake_alloc()

static request_t * request_fake_alloc ( void  )
static

Definition at line 60 of file tmpl_tests.c.

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

◆ test_cast_invalid()

static void test_cast_invalid ( void  )
static

Definition at line 464 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_cast_uint32_to_uint64()

static void test_cast_uint32_to_uint64 ( void  )
static

Definition at line 440 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_cast_unresolved_to_string()

static void test_cast_unresolved_to_string ( void  )
static

Definition at line 419 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_cast_unresolved_to_uint32()

static void test_cast_unresolved_to_uint32 ( void  )
static

Definition at line 390 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_copy_attr()

static void test_copy_attr ( void  )
static

Definition at line 512 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_copy_data()

static void test_copy_data ( void  )
static

Definition at line 486 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_copy_data_unresolved()

static void test_copy_data_unresolved ( void  )
static

Definition at line 534 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_eval_attr_count()

static void test_eval_attr_count ( void  )
static

Definition at line 699 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_eval_attr_found()

static void test_eval_attr_found ( void  )
static

Definition at line 591 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_eval_attr_missing()

static void test_eval_attr_missing ( void  )
static

Definition at line 627 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_eval_attr_multiple()

static void test_eval_attr_multiple ( void  )
static

Definition at line 658 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_eval_data()

static void test_eval_data ( void  )
static

Definition at line 559 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_find_or_add_existing()

static void test_find_or_add_existing ( void  )
static

Definition at line 787 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_find_or_add_new()

static void test_find_or_add_new ( void  )
static

Definition at line 813 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_find_vp_found()

static void test_find_vp_found ( void  )
static

Definition at line 741 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_find_vp_missing()

static void test_find_vp_missing ( void  )
static

Definition at line 766 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_from_value_box_ipaddr()

static void test_from_value_box_ipaddr ( void  )
static

Definition at line 365 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_from_value_box_string()

static void test_from_value_box_string ( void  )
static

Definition at line 325 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_from_value_box_uint32()

static void test_from_value_box_uint32 ( void  )
static

Definition at line 345 of file tmpl_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 tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_attr_all()

static void test_parse_attr_all ( void  )
static

Definition at line 123 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_attr_count()

static void test_parse_attr_count ( void  )
static

Definition at line 138 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_attr_empty_ref()

static void test_parse_attr_empty_ref ( void  )
static

Definition at line 1004 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_attr_emptystring()

static void test_parse_attr_emptystring ( void  )
static

Definition at line 219 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_attr_index()

static void test_parse_attr_index ( void  )
static

Definition at line 107 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_attr_invalid()

static void test_parse_attr_invalid ( void  )
static

Definition at line 207 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_attr_last()

static void test_parse_attr_last ( void  )
static

Definition at line 153 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_attr_missing()

static void test_parse_attr_missing ( void  )
static

Definition at line 186 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_attr_nested()

static void test_parse_attr_nested ( void  )
static

Definition at line 168 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_attr_simple()

static void test_parse_attr_simple ( void  )
static

Definition at line 92 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_attr_unresolved_disallowed()

static void test_parse_attr_unresolved_disallowed ( void  )
static

Definition at line 1018 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_bareword_attr()

static void test_parse_bareword_attr ( void  )
static

Definition at line 243 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_double_quoted_literal()

static void test_parse_double_quoted_literal ( void  )
static

Definition at line 277 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_double_quoted_xlat()

static void test_parse_double_quoted_xlat ( void  )
static

Definition at line 296 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_parse_single_quoted()

static void test_parse_single_quoted ( void  )
static

Definition at line 258 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_print_attr()

static void test_print_attr ( void  )
static

Definition at line 840 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_print_data_string()

static void test_print_data_string ( void  )
static

Definition at line 863 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_print_data_uint32()

static void test_print_data_uint32 ( void  )
static

Definition at line 890 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_print_quoted()

static void test_print_quoted ( void  )
static

Definition at line 917 of file tmpl_tests.c.

+ Here is the call graph for this function:

◆ test_type_checking()

static void test_type_checking ( void  )
static

Definition at line 952 of file tmpl_tests.c.

+ Here is the call graph for this function:

Variable Documentation

◆ autofree

TALLOC_CTX* autofree
static

Definition at line 34 of file tmpl_tests.c.

◆ test_dict

fr_dict_t* test_dict
static

Definition at line 35 of file tmpl_tests.c.

◆ TEST_LIST

TEST_LIST

Definition at line 1037 of file tmpl_tests.c.