The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions | Variables
rb_tests.c File Reference

Tests for rbtrees. More...

#include <freeradius-devel/util/acutest.h>
#include <freeradius-devel/util/acutest_helpers.h>
#include <freeradius-devel/util/rand.h>
#include <freeradius-devel/util/rb.h>
+ Include dependency graph for rb_tests.c:

Go to the source code of this file.

Data Structures

struct  fr_rb_tree_test_node_t
 

Macros

#define MAXSIZE   128
 

Functions

static int fr_rb_qsort_cmp (void const *one, void const *two)
 
static int8_t fr_rb_tree_test_cmp (void const *one, void const *two)
 
static bool is_prime (uint32_t n)
 
static void test_fr_rb_iter_delete (void)
 
static void test_fr_rb_iter_inorder (void)
 
static void test_fr_rb_iter_postorder (void)
 
static void test_fr_rb_iter_preorder (void)
 

Variables

static uint32_t non_primes []
 
static uint32_t post_output [] = {0, 4, 3, 144, 49, 4096, 25194, 8192, 256, 15}
 
static uint32_t pre_output [] = {15, 3, 0, 4, 256, 49, 144, 8192, 4096, 25194}
 
static uint32_t pre_post_input [] = {0, 15, 256, 49, 3, 8192, 144, 4, 4096, 25194}
 
 TEST_LIST
 

Detailed Description

Tests for rbtrees.

Definition in file rb_tests.c.


Data Structure Documentation

◆ fr_rb_tree_test_node_t

struct fr_rb_tree_test_node_t

Definition at line 30 of file rb_tests.c.

+ Collaboration diagram for fr_rb_tree_test_node_t:
Data Fields
fr_rb_node_t node
uint32_t num

Macro Definition Documentation

◆ MAXSIZE

#define MAXSIZE   128

Definition at line 28 of file rb_tests.c.

Function Documentation

◆ fr_rb_qsort_cmp()

static int fr_rb_qsort_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 41 of file rb_tests.c.

+ Here is the caller graph for this function:

◆ fr_rb_tree_test_cmp()

static int8_t fr_rb_tree_test_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 35 of file rb_tests.c.

+ Here is the caller graph for this function:

◆ is_prime()

static bool is_prime ( uint32_t  n)
static

Definition at line 156 of file rb_tests.c.

+ Here is the caller graph for this function:

◆ test_fr_rb_iter_delete()

static void test_fr_rb_iter_delete ( void  )
static

Definition at line 171 of file rb_tests.c.

+ Here is the call graph for this function:

◆ test_fr_rb_iter_inorder()

static void test_fr_rb_iter_inorder ( void  )
static

Definition at line 47 of file rb_tests.c.

+ Here is the call graph for this function:

◆ test_fr_rb_iter_postorder()

static void test_fr_rb_iter_postorder ( void  )
static

Definition at line 123 of file rb_tests.c.

+ Here is the call graph for this function:

◆ test_fr_rb_iter_preorder()

static void test_fr_rb_iter_preorder ( void  )
static

Definition at line 93 of file rb_tests.c.

+ Here is the call graph for this function:

Variable Documentation

◆ non_primes

uint32_t non_primes[]
static
Initial value:
= { 1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28,
30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50}

Definition at line 168 of file rb_tests.c.

◆ post_output

uint32_t post_output[] = {0, 4, 3, 144, 49, 4096, 25194, 8192, 256, 15}
static

Definition at line 91 of file rb_tests.c.

◆ pre_output

uint32_t pre_output[] = {15, 3, 0, 4, 256, 49, 144, 8192, 4096, 25194}
static

Definition at line 90 of file rb_tests.c.

◆ pre_post_input

uint32_t pre_post_input[] = {0, 15, 256, 49, 3, 8192, 144, 4, 4096, 25194}
static

Definition at line 89 of file rb_tests.c.

◆ TEST_LIST

TEST_LIST
Initial value:
= {
{ "fr_rb_iter_inorder", test_fr_rb_iter_inorder },
{ "fr_rb_iter_preorder", test_fr_rb_iter_preorder },
{ "fr_rb_iter_postorder", test_fr_rb_iter_postorder },
{ "fr_rb_iter_delete", test_fr_rb_iter_delete },
{ NULL }
}
static void test_fr_rb_iter_postorder(void)
Definition: rb_tests.c:123
static void test_fr_rb_iter_inorder(void)
Definition: rb_tests.c:47
static void test_fr_rb_iter_delete(void)
Definition: rb_tests.c:171
static void test_fr_rb_iter_preorder(void)
Definition: rb_tests.c:93

Definition at line 213 of file rb_tests.c.