syslog-ng source
test_nvtable.c File Reference
#include <criterion/criterion.h>
#include "logmsg/nvtable.h"
#include "apphook.h"
#include "logmsg/logmsg.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
Include dependency graph for test_nvtable.c:

Macros

#define STATIC_VALUES   16
 
#define STATIC_HANDLE   1
 
#define STATIC_NAME   "VAL1"
 
#define DYN_HANDLE   17
 
#define DYN_NAME   "VAL17"
 
#define TEST_NVHANDLE_MAX_VALUE   10
 

Functions

void assert_nvtable (NVTable *tab, NVHandle handle, gchar *expected_value, gssize expected_length)
 
 TestSuite (nvtable,.init=app_startup,.fini=app_shutdown)
 
 Test (nvtable, test_nv_registry)
 
 Test (nvtable, test_nvtable_direct)
 
 Test (nvtable, test_nvtable_indirect)
 
 Test (nvtable, test_nvtable_others)
 
 Test (nvtable, test_nvtable_lookup)
 
 Test (nvtable, test_nvtable_clone_grows_the_cloned_structure)
 
 Test (nvtable, test_nvtable_clone_cannot_grow_nvtable_larger_than_nvtable_max_bytes)
 
 Test (nvtable, test_nvtable_realloc_doubles_nvtable_size)
 
 Test (nvtable, test_nvtable_realloc_sets_size_to_nv_table_max_bytes_at_most)
 
 Test (nvtable, test_nvtable_realloc_fails_if_size_is_at_maximum)
 
 Test (nvtable, test_nvtable_realloc_leaves_original_intact_if_there_are_multiple_references)
 
 Test (nvtable, test_nvtable_unset_values)
 
 Test (nvtable, test_nvtable_unset_copies_indirect_references)
 
 Test (nvtable, test_nvtable_indirect_references_unset_and_then_set_again_are_present)
 
 Test (nvtable, test_nvtable_compact_copies_name_value_pairs)
 
 Test (nvtable, test_nvtable_compact_skips_unset_values)
 

Macro Definition Documentation

◆ DYN_HANDLE

#define DYN_HANDLE   17

◆ DYN_NAME

#define DYN_NAME   "VAL17"

◆ STATIC_HANDLE

#define STATIC_HANDLE   1

◆ STATIC_NAME

#define STATIC_NAME   "VAL1"

◆ STATIC_VALUES

#define STATIC_VALUES   16

◆ TEST_NVHANDLE_MAX_VALUE

#define TEST_NVHANDLE_MAX_VALUE   10

Function Documentation

◆ assert_nvtable()

void assert_nvtable ( NVTable *  tab,
NVHandle  handle,
gchar *  expected_value,
gssize  expected_length 
)

◆ Test() [1/16]

Test ( nvtable  ,
test_nv_registry   
)

◆ Test() [2/16]

Test ( nvtable  ,
test_nvtable_clone_cannot_grow_nvtable_larger_than_nvtable_max_bytes   
)

◆ Test() [3/16]

Test ( nvtable  ,
test_nvtable_clone_grows_the_cloned_structure   
)

◆ Test() [4/16]

Test ( nvtable  ,
test_nvtable_compact_copies_name_value_pairs   
)

◆ Test() [5/16]

Test ( nvtable  ,
test_nvtable_compact_skips_unset_values   
)

◆ Test() [6/16]

Test ( nvtable  ,
test_nvtable_direct   
)

◆ Test() [7/16]

Test ( nvtable  ,
test_nvtable_indirect   
)

◆ Test() [8/16]

Test ( nvtable  ,
test_nvtable_indirect_references_unset_and_then_set_again_are_present   
)

◆ Test() [9/16]

Test ( nvtable  ,
test_nvtable_lookup   
)

◆ Test() [10/16]

Test ( nvtable  ,
test_nvtable_others   
)

◆ Test() [11/16]

Test ( nvtable  ,
test_nvtable_realloc_doubles_nvtable_size   
)

◆ Test() [12/16]

Test ( nvtable  ,
test_nvtable_realloc_fails_if_size_is_at_maximum   
)

◆ Test() [13/16]

Test ( nvtable  ,
test_nvtable_realloc_leaves_original_intact_if_there_are_multiple_references   
)

◆ Test() [14/16]

Test ( nvtable  ,
test_nvtable_realloc_sets_size_to_nv_table_max_bytes_at_most   
)

◆ Test() [15/16]

Test ( nvtable  ,
test_nvtable_unset_copies_indirect_references   
)

◆ Test() [16/16]

Test ( nvtable  ,
test_nvtable_unset_values   
)

◆ TestSuite()

TestSuite ( nvtable  ,
init = app_startup,
fini = app_shutdown 
)