The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Typedefs | Functions | Variables
dbuff_tests.c File Reference
#include <freeradius-devel/util/acutest.h>
#include <freeradius-devel/util/acutest_helpers.h>
#include <float.h>
#include "dbuff.h"
+ Include dependency graph for dbuff_tests.c:

Go to the source code of this file.

Typedefs

typedef void(* fr_dbuff_fd_test_body) (fr_dbuff_t *dbuff, uint8_t const data[])
 

Functions

static void fd_body (fr_dbuff_t *dbuff, uint8_t const data[])
 
static void max_body (fr_dbuff_t *dbuff, uint8_t const data[])
 
static void test_dbuff_fd (void)
 
static void test_dbuff_fd_max (void)
 
static void test_dbuff_fd_shell (fr_dbuff_fd_test_body body, uint8_t const data[], size_t datasize, uint8_t buff[], size_t buffsize, size_t max)
 
static void test_dbuff_init (void)
 
static void test_dbuff_init_no_parent (void)
 
static void test_dbuff_max (void)
 
static void test_dbuff_move (void)
 
static void test_dbuff_net_encode (void)
 Test the various dbuff_net_encode() functions and macros. More...
 
static void test_dbuff_no_advance (void)
 
static void test_dbuff_out (void)
 Test functions that read from dbuffs. More...
 
static void test_dbuff_talloc_extend (void)
 Test extensible dbuffs. More...
 
static void test_dbuff_talloc_extend_multi_level (void)
 

Variables

 TEST_LIST
 

Typedef Documentation

◆ fr_dbuff_fd_test_body

typedef void(* fr_dbuff_fd_test_body) (fr_dbuff_t *dbuff, uint8_t const data[])

Definition at line 12 of file dbuff_tests.c.

Function Documentation

◆ fd_body()

static void fd_body ( fr_dbuff_t dbuff,
uint8_t const  data[] 
)
static

Definition at line 352 of file dbuff_tests.c.

+ Here is the caller graph for this function:

◆ max_body()

static void max_body ( fr_dbuff_t dbuff,
uint8_t const  data[] 
)
static

Definition at line 381 of file dbuff_tests.c.

+ Here is the caller graph for this function:

◆ test_dbuff_fd()

static void test_dbuff_fd ( void  )
static

Definition at line 371 of file dbuff_tests.c.

+ Here is the call graph for this function:

◆ test_dbuff_fd_max()

static void test_dbuff_fd_max ( void  )
static

Definition at line 396 of file dbuff_tests.c.

+ Here is the call graph for this function:

◆ test_dbuff_fd_shell()

static void test_dbuff_fd_shell ( fr_dbuff_fd_test_body  body,
uint8_t const  data[],
size_t  datasize,
uint8_t  buff[],
size_t  buffsize,
size_t  max 
)
static

Definition at line 334 of file dbuff_tests.c.

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

◆ test_dbuff_init()

static void test_dbuff_init ( void  )
static

Definition at line 14 of file dbuff_tests.c.

◆ test_dbuff_init_no_parent()

static void test_dbuff_init_no_parent ( void  )
static

Definition at line 41 of file dbuff_tests.c.

◆ test_dbuff_max()

static void test_dbuff_max ( void  )
static

Definition at line 51 of file dbuff_tests.c.

◆ test_dbuff_move()

static void test_dbuff_move ( void  )
static

Definition at line 223 of file dbuff_tests.c.

+ Here is the call graph for this function:

◆ test_dbuff_net_encode()

static void test_dbuff_net_encode ( void  )
static

Test the various dbuff_net_encode() functions and macros.

Note
Passing constants to fr_dbuff_in() as it is written results in warnings about narrowing casts on the constants–but those casts are in the underlying inlined fr_nbo_from*() functions. They have to be there; that's how those functions work. (The tests worked despite the warnings.) Using variables avoids the warnings, at least with the compile options the build system uses by default.

Definition at line 77 of file dbuff_tests.c.

+ Here is the call graph for this function:

◆ test_dbuff_no_advance()

static void test_dbuff_no_advance ( void  )
static

Definition at line 203 of file dbuff_tests.c.

◆ test_dbuff_out()

static void test_dbuff_out ( void  )
static

Test functions that read from dbuffs.

Definition at line 409 of file dbuff_tests.c.

+ Here is the call graph for this function:

◆ test_dbuff_talloc_extend()

static void test_dbuff_talloc_extend ( void  )
static

Test extensible dbuffs.

Definition at line 268 of file dbuff_tests.c.

+ Here is the call graph for this function:

◆ test_dbuff_talloc_extend_multi_level()

static void test_dbuff_talloc_extend_multi_level ( void  )
static

Definition at line 302 of file dbuff_tests.c.

+ Here is the call graph for this function:

Variable Documentation

◆ TEST_LIST

TEST_LIST
Initial value:
= {
{ "fr_dbuff_init", test_dbuff_init },
{ "fr_dbuff_init_no_parent", test_dbuff_init_no_parent },
{ "fr_dbuff_max", test_dbuff_max },
{ "fr_dbuff_in", test_dbuff_net_encode },
{ "fr_dbuff_no_advance", test_dbuff_no_advance },
{ "fr_dbuff_move", test_dbuff_move },
{ "fr_dbuff_talloc_extend", test_dbuff_talloc_extend },
{ "fr_dbuff_talloc_extend_multi_level", test_dbuff_talloc_extend_multi_level },
{ "fr_dbuff_fd", test_dbuff_fd },
{ "fr_dbuff_fd_max", test_dbuff_fd_max },
{ "fr_dbuff_out", test_dbuff_out },
{ NULL }
}
static void test_dbuff_init_no_parent(void)
Definition: dbuff_tests.c:41
static void test_dbuff_talloc_extend(void)
Test extensible dbuffs.
Definition: dbuff_tests.c:268
static void test_dbuff_out(void)
Test functions that read from dbuffs.
Definition: dbuff_tests.c:409
static void test_dbuff_max(void)
Definition: dbuff_tests.c:51
static void test_dbuff_talloc_extend_multi_level(void)
Definition: dbuff_tests.c:302
static void test_dbuff_init(void)
Definition: dbuff_tests.c:14
static void test_dbuff_no_advance(void)
Definition: dbuff_tests.c:203
static void test_dbuff_net_encode(void)
Test the various dbuff_net_encode() functions and macros.
Definition: dbuff_tests.c:77
static void test_dbuff_move(void)
Definition: dbuff_tests.c:223
static void test_dbuff_fd(void)
Definition: dbuff_tests.c:371
static void test_dbuff_fd_max(void)
Definition: dbuff_tests.c:396

Definition at line 510 of file dbuff_tests.c.