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

Tests for the internal encoder writing into a talloc dbuff that must grow. More...

#include "acutest_common_init.h"
#include <freeradius-devel/util/conf.h>
#include <freeradius-devel/util/dbuff.h>
#include <freeradius-devel/util/dict_test.h>
#include <freeradius-devel/util/pair.h>
#include <freeradius-devel/internal/internal.h>
+ Include dependency graph for internal_encode_tests.c:

Go to the source code of this file.

Macros

#define TEST_GLOBAL_FINI   test_fini()
 
#define TEST_GLOBAL_INIT   test_init()
 

Functions

static void test_encode_talloc_extend (void)
 Encode one pair into talloc dbuffs of every initial size up to the encoded length.
 
static void test_fini (void)
 Release the internal dictionary before the dictionary context is freed.
 
static void test_init (void)
 Global initialisation.
 

Variables

static TALLOC_CTX * autofree
 
static fr_dict_t * internal_dict
 
static fr_dict_t * test_dict
 
 TEST_LIST
 

Detailed Description

Tests for the internal encoder writing into a talloc dbuff that must grow.

Definition in file internal_encode_tests.c.

Macro Definition Documentation

◆ TEST_GLOBAL_FINI

#define TEST_GLOBAL_FINI   test_fini()

Definition at line 26 of file internal_encode_tests.c.

◆ TEST_GLOBAL_INIT

#define TEST_GLOBAL_INIT   test_init()

Definition at line 25 of file internal_encode_tests.c.

Function Documentation

◆ test_encode_talloc_extend()

static void test_encode_talloc_extend ( void  )
static

Encode one pair into talloc dbuffs of every initial size up to the encoded length.

Each initial size puts the end of the buffer at a different point in the encoding. A talloc dbuff grows on demand, so every size must produce the same bytes as the encoding into a fixed buffer.

Definition at line 78 of file internal_encode_tests.c.

+ Here is the call graph for this function:

◆ test_fini()

static void test_fini ( void  )
static

Release the internal dictionary before the dictionary context is freed.

Definition at line 67 of file internal_encode_tests.c.

+ Here is the call graph for this function:

◆ test_init()

static void test_init ( void  )
static

Global initialisation.

Definition at line 42 of file internal_encode_tests.c.

+ Here is the call graph for this function:

Variable Documentation

◆ autofree

TALLOC_CTX* autofree
static

Definition at line 36 of file internal_encode_tests.c.

◆ internal_dict

fr_dict_t* internal_dict
static

Definition at line 38 of file internal_encode_tests.c.

◆ test_dict

fr_dict_t* test_dict
static

Definition at line 37 of file internal_encode_tests.c.

◆ TEST_LIST

TEST_LIST
Initial value:
= {
{ "encode_talloc_extend", test_encode_talloc_extend },
}
#define TEST_TERMINATOR
Definition acutest.h:77
static void test_encode_talloc_extend(void)
Encode one pair into talloc dbuffs of every initial size up to the encoded length.

Definition at line 117 of file internal_encode_tests.c.