The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
Macros | Functions | Variables
pair_tokenize_tests.c File Reference

Tests for fr_pair_ctx_afrom_substr() More...

#include "acutest_common_init.h"
#include "acutest_helpers.h"
#include <freeradius-devel/util/dict_test.h>
#include <freeradius-devel/util/pair.h>
+ Include dependency graph for pair_tokenize_tests.c:

Go to the source code of this file.

Macros

#define TEST_GLOBAL_INIT   test_init()
 

Functions

static void pair_ctx_check_error (fr_pair_ctx_t *pair_ctx, char const *in, fr_slen_t offset, char const *msg)
 Check that a parse fails at the expected offset with the expected message.
 
static void pair_ctx_init (fr_pair_ctx_t *pair_ctx, fr_pair_list_t *list)
 Start a parsing context at the root of the test dictionary.
 
static void test_context_nested (void)
 
static void test_context_structural (void)
 
static void test_errors (void)
 
static void test_init (void)
 Global initialisation.
 
static void test_leaf_bareword_stops_at_comma (void)
 
static void test_leaf_leading_whitespace (void)
 The sbuff bounds the input, so skipping leading whitespace cannot run past the end of the input.
 
static void test_leaf_quoted (void)
 
static void test_whitespace_only (void)
 

Variables

static TALLOC_CTX * autofree
 
static fr_dict_t * test_dict
 
 TEST_LIST
 

Detailed Description

Tests for fr_pair_ctx_afrom_substr()

Definition in file pair_tokenize_tests.c.

Macro Definition Documentation

◆ TEST_GLOBAL_INIT

#define TEST_GLOBAL_INIT   test_init()

Definition at line 25 of file pair_tokenize_tests.c.

Function Documentation

◆ pair_ctx_check_error()

static void pair_ctx_check_error ( fr_pair_ctx_t *  pair_ctx,
char const *  in,
fr_slen_t  offset,
char const *  msg 
)
static

Check that a parse fails at the expected offset with the expected message.

Definition at line 258 of file pair_tokenize_tests.c.

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

◆ pair_ctx_init()

static void pair_ctx_init ( fr_pair_ctx_t *  pair_ctx,
fr_pair_list_t *  list 
)
static

Start a parsing context at the root of the test dictionary.

Definition at line 57 of file pair_tokenize_tests.c.

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

◆ test_context_nested()

static void test_context_nested ( void  )
static

Definition at line 197 of file pair_tokenize_tests.c.

+ Here is the call graph for this function:

◆ test_context_structural()

static void test_context_structural ( void  )
static

Definition at line 165 of file pair_tokenize_tests.c.

+ Here is the call graph for this function:

◆ test_errors()

static void test_errors ( void  )
static

Definition at line 269 of file pair_tokenize_tests.c.

+ Here is the call graph for this function:

◆ test_init()

static void test_init ( void  )
static

Global initialisation.

Definition at line 38 of file pair_tokenize_tests.c.

+ Here is the call graph for this function:

◆ test_leaf_bareword_stops_at_comma()

static void test_leaf_bareword_stops_at_comma ( void  )
static

Definition at line 91 of file pair_tokenize_tests.c.

+ Here is the call graph for this function:

◆ test_leaf_leading_whitespace()

static void test_leaf_leading_whitespace ( void  )
static

The sbuff bounds the input, so skipping leading whitespace cannot run past the end of the input.

Definition at line 131 of file pair_tokenize_tests.c.

+ Here is the call graph for this function:

◆ test_leaf_quoted()

static void test_leaf_quoted ( void  )
static

Definition at line 65 of file pair_tokenize_tests.c.

+ Here is the call graph for this function:

◆ test_whitespace_only()

static void test_whitespace_only ( void  )
static

Definition at line 151 of file pair_tokenize_tests.c.

+ Here is the call graph for this function:

Variable Documentation

◆ autofree

TALLOC_CTX* autofree
static

Definition at line 33 of file pair_tokenize_tests.c.

◆ test_dict

fr_dict_t* test_dict
static

Definition at line 34 of file pair_tokenize_tests.c.

◆ TEST_LIST

TEST_LIST
Initial value:
= {
{ "leaf_quoted", test_leaf_quoted },
{ "leaf_bareword_stops_at_comma", test_leaf_bareword_stops_at_comma },
{ "leaf_leading_whitespace", test_leaf_leading_whitespace },
{ "whitespace_only", test_whitespace_only },
{ "context_structural", test_context_structural },
{ "context_nested", test_context_nested },
{ "errors", test_errors },
}
#define TEST_TERMINATOR
Definition acutest.h:77
static void test_whitespace_only(void)
static void test_leaf_quoted(void)
static void test_context_structural(void)
static void test_context_nested(void)
static void test_leaf_bareword_stops_at_comma(void)
static void test_errors(void)
static void test_leaf_leading_whitespace(void)
The sbuff bounds the input, so skipping leading whitespace cannot run past the end of the input.

Definition at line 311 of file pair_tokenize_tests.c.