OpenVPN
Data Structures | Macros | Functions
test_buffer.c File Reference
#include "syshead.h"
#include <setjmp.h>
#include <cmocka.h>
#include "buffer.h"
#include "buffer.c"
Include dependency graph for test_buffer.c:

Go to the source code of this file.

Data Structures

struct  test_buffer_list_aggregate_ctx
 

Macros

#define testsep   ","
 
#define testnosep   ""
 
#define teststr1   "one"
 
#define teststr2   "two"
 
#define teststr3   "three"
 
#define teststr4   "four"
 
#define assert_buf_equals_str(buf, str)
 

Functions

static void test_buffer_strprefix (void **state)
 
static int test_buffer_list_setup (void **state)
 
static int test_buffer_list_teardown (void **state)
 
static void test_buffer_list_full (void **state)
 
static void test_buffer_list_aggregate_separator_empty (void **state)
 
static void test_buffer_list_aggregate_separator_noop (void **state)
 
static void test_buffer_list_aggregate_separator_two (void **state)
 
static void test_buffer_list_aggregate_separator_all (void **state)
 
static void test_buffer_list_aggregate_separator_nosep (void **state)
 
static void test_buffer_list_aggregate_separator_zerolen (void **state)
 
static void test_buffer_list_aggregate_separator_emptybuffers (void **state)
 
static void test_buffer_free_gc_one (void **state)
 
static void test_buffer_free_gc_two (void **state)
 
int main (void)
 

Macro Definition Documentation

◆ assert_buf_equals_str

#define assert_buf_equals_str (   buf,
  str 
)
Value:
assert_int_equal(BLEN(buf), strlen(str)); \
assert_memory_equal(BPTR(buf), str, BLEN(buf));
#define BPTR(buf)
Definition: buffer.h:124
#define BLEN(buf)
Definition: buffer.h:127
#define assert_int_equal(a, b)
Definition: cmocka.h:1174

Definition at line 55 of file test_buffer.c.

Referenced by test_buffer_list_aggregate_separator_all(), test_buffer_list_aggregate_separator_noop(), test_buffer_list_aggregate_separator_nosep(), test_buffer_list_aggregate_separator_two(), and test_buffer_list_aggregate_separator_zerolen().

◆ testnosep

#define testnosep   ""

◆ testsep

#define testsep   ","

◆ teststr1

#define teststr1   "one"

◆ teststr2

#define teststr2   "two"

◆ teststr3

#define teststr3   "three"

◆ teststr4

#define teststr4   "four"

Definition at line 53 of file test_buffer.c.

Referenced by test_buffer_list_full().

Function Documentation

◆ main()

int main ( void  )

◆ test_buffer_free_gc_one()

static void test_buffer_free_gc_one ( void **  state)
static

◆ test_buffer_free_gc_two()

static void test_buffer_free_gc_two ( void **  state)
static

◆ test_buffer_list_aggregate_separator_all()

static void test_buffer_list_aggregate_separator_all ( void **  state)
static

◆ test_buffer_list_aggregate_separator_empty()

static void test_buffer_list_aggregate_separator_empty ( void **  state)
static

◆ test_buffer_list_aggregate_separator_emptybuffers()

static void test_buffer_list_aggregate_separator_emptybuffers ( void **  state)
static

◆ test_buffer_list_aggregate_separator_noop()

static void test_buffer_list_aggregate_separator_noop ( void **  state)
static

◆ test_buffer_list_aggregate_separator_nosep()

static void test_buffer_list_aggregate_separator_nosep ( void **  state)
static

◆ test_buffer_list_aggregate_separator_two()

static void test_buffer_list_aggregate_separator_two ( void **  state)
static

◆ test_buffer_list_aggregate_separator_zerolen()

static void test_buffer_list_aggregate_separator_zerolen ( void **  state)
static

◆ test_buffer_list_full()

static void test_buffer_list_full ( void **  state)
static

◆ test_buffer_list_setup()

static int test_buffer_list_setup ( void **  state)
static

◆ test_buffer_list_teardown()

static int test_buffer_list_teardown ( void **  state)
static

◆ test_buffer_strprefix()

static void test_buffer_strprefix ( void **  state)
static

Definition at line 39 of file test_buffer.c.

References assert_false, assert_true, and strprefix().

Referenced by main().