Tests for cf_file, cf_util, and cf_parse.
More...
#include <freeradius-devel/util/test/acutest.h>
#include <freeradius-devel/util/test/acutest_helpers.h>
#include <freeradius-devel/server/cf_file.h>
#include <freeradius-devel/server/cf_parse.h>
#include <freeradius-devel/server/tmpl.h>
#include <freeradius-devel/server/cf_priv.h>
Go to the source code of this file.
Tests for cf_file, cf_util, and cf_parse.
- Copyright
- 2026 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file cf_tests.c.
◆ test_octets_t
◆ TEST_INIT
◆ test_cf_root()
| static void test_cf_root |
( |
void |
| ) |
|
|
static |
◆ test_config_item_count()
| static unsigned int test_config_item_count |
( |
CONF_SECTION * |
cs | ) |
|
|
static |
Count the pairs and sections in a section, ignoring CONF_DATA.
cf_file_read() and cf_file_read_buffer() both attach the file dedup tree to the section as CONF_DATA, so an "empty" configuration is never childless.
Definition at line 1189 of file cf_tests.c.
◆ test_data_add_find()
| static void test_data_add_find |
( |
void |
| ) |
|
|
static |
◆ test_data_find_missing()
| static void test_data_find_missing |
( |
void |
| ) |
|
|
static |
◆ test_data_remove()
| static void test_data_remove |
( |
void |
| ) |
|
|
static |
◆ test_expand_missing_ref()
| static void test_expand_missing_ref |
( |
void |
| ) |
|
|
static |
◆ test_expand_nested_ref()
| static void test_expand_nested_ref |
( |
void |
| ) |
|
|
static |
◆ test_expand_no_variables()
| static void test_expand_no_variables |
( |
void |
| ) |
|
|
static |
◆ test_expand_section_ref()
| static void test_expand_section_ref |
( |
void |
| ) |
|
|
static |
◆ test_file_read_buffer_comment_only()
| static void test_file_read_buffer_comment_only |
( |
void |
| ) |
|
|
static |
◆ test_file_read_buffer_continuation_no_newline()
| static void test_file_read_buffer_continuation_no_newline |
( |
void |
| ) |
|
|
static |
◆ test_file_read_buffer_pair()
| static void test_file_read_buffer_pair |
( |
void |
| ) |
|
|
static |
◆ test_file_read_empty_file()
| static void test_file_read_empty_file |
( |
void |
| ) |
|
|
static |
◆ test_filename_lineno()
| static void test_filename_lineno |
( |
void |
| ) |
|
|
static |
◆ test_filename_set()
| static void test_filename_set |
( |
void |
| ) |
|
|
static |
◆ test_init()
| static void test_init |
( |
void |
| ) |
|
|
static |
Global initialisation.
Definition at line 38 of file cf_tests.c.
◆ test_item_free_children()
| static void test_item_free_children |
( |
void |
| ) |
|
|
static |
◆ test_item_mark_parsed()
| static void test_item_mark_parsed |
( |
void |
| ) |
|
|
static |
◆ test_item_next_mixed()
| static void test_item_next_mixed |
( |
void |
| ) |
|
|
static |
◆ test_item_remove_pair()
| static void test_item_remove_pair |
( |
void |
| ) |
|
|
static |
◆ test_item_remove_section()
| static void test_item_remove_section |
( |
void |
| ) |
|
|
static |
◆ test_lineno_set()
| static void test_lineno_set |
( |
void |
| ) |
|
|
static |
◆ test_pair_alloc_basic()
| static void test_pair_alloc_basic |
( |
void |
| ) |
|
|
static |
◆ test_pair_alloc_no_value()
| static void test_pair_alloc_no_value |
( |
void |
| ) |
|
|
static |
◆ test_pair_alloc_operators()
| static void test_pair_alloc_operators |
( |
void |
| ) |
|
|
static |
◆ test_pair_alloc_quoted()
| static void test_pair_alloc_quoted |
( |
void |
| ) |
|
|
static |
◆ test_pair_count()
| static void test_pair_count |
( |
void |
| ) |
|
|
static |
◆ test_pair_count_descendents()
| static void test_pair_count_descendents |
( |
void |
| ) |
|
|
static |
◆ test_pair_dup()
| static void test_pair_dup |
( |
void |
| ) |
|
|
static |
◆ test_pair_find_basic()
| static void test_pair_find_basic |
( |
void |
| ) |
|
|
static |
◆ test_pair_find_missing()
| static void test_pair_find_missing |
( |
void |
| ) |
|
|
static |
◆ test_pair_find_next()
| static void test_pair_find_next |
( |
void |
| ) |
|
|
static |
◆ test_pair_first_next()
| static void test_pair_first_next |
( |
void |
| ) |
|
|
static |
◆ test_pair_in_table_found()
| static void test_pair_in_table_found |
( |
void |
| ) |
|
|
static |
◆ test_pair_in_table_invalid()
| static void test_pair_in_table_invalid |
( |
void |
| ) |
|
|
static |
◆ test_pair_parse_octets_quote()
| static void test_pair_parse_octets_quote |
( |
void |
| ) |
|
|
static |
The quotes around a value are the type hint for an octets item.
The parser reads a bare word that starts with 0x as hexadecimal bytes. A quoted value is text, even when the text starts with 0x, so "0xff" is the four characters of the text and not one byte. The parser processes escape sequences in the text.
Definition at line 1316 of file cf_tests.c.
◆ test_pair_prev()
| static void test_pair_prev |
( |
void |
| ) |
|
|
static |
◆ test_pair_replace()
| static void test_pair_replace |
( |
void |
| ) |
|
|
static |
◆ test_pair_to_item_roundtrip()
| static void test_pair_to_item_roundtrip |
( |
void |
| ) |
|
|
static |
◆ test_reference_item_missing()
| static void test_reference_item_missing |
( |
void |
| ) |
|
|
static |
◆ test_reference_item_pair()
| static void test_reference_item_pair |
( |
void |
| ) |
|
|
static |
◆ test_reference_item_section()
| static void test_reference_item_section |
( |
void |
| ) |
|
|
static |
◆ test_section_alloc_name1_name2()
| static void test_section_alloc_name1_name2 |
( |
void |
| ) |
|
|
static |
◆ test_section_alloc_name1_only()
| static void test_section_alloc_name1_only |
( |
void |
| ) |
|
|
static |
◆ test_section_alloc_parent()
| static void test_section_alloc_parent |
( |
void |
| ) |
|
|
static |
◆ test_section_dup_basic()
| static void test_section_dup_basic |
( |
void |
| ) |
|
|
static |
◆ test_section_dup_nested_pairs()
| static void test_section_dup_nested_pairs |
( |
void |
| ) |
|
|
static |
◆ test_section_dup_rename()
| static void test_section_dup_rename |
( |
void |
| ) |
|
|
static |
◆ test_section_find_child()
| static void test_section_find_child |
( |
void |
| ) |
|
|
static |
◆ test_section_find_missing()
| static void test_section_find_missing |
( |
void |
| ) |
|
|
static |
◆ test_section_find_name1_name2()
| static void test_section_find_name1_name2 |
( |
void |
| ) |
|
|
static |
◆ test_section_find_next()
| static void test_section_find_next |
( |
void |
| ) |
|
|
static |
◆ test_section_first_next()
| static void test_section_first_next |
( |
void |
| ) |
|
|
static |
◆ test_section_name_cmp()
| static void test_section_name_cmp |
( |
void |
| ) |
|
|
static |
◆ test_section_prev()
| static void test_section_prev |
( |
void |
| ) |
|
|
static |
◆ test_section_to_item_roundtrip()
| static void test_section_to_item_roundtrip |
( |
void |
| ) |
|
|
static |
◆ test_section_value_find()
| static void test_section_value_find |
( |
void |
| ) |
|
|
static |
◆ autofree
◆ TEST_LIST
◆ test_octets_rules
Initial value:= {
}
#define CONF_PARSER_TERMINATOR
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition at line 1301 of file cf_tests.c.
◆ test_table
Initial value:= {
}
#define L(_str)
Helper for initialising arrays of string literals.
Definition at line 1134 of file cf_tests.c.
◆ test_table_len