OpenVPN
test_group_setup_assert.c
Go to the documentation of this file.
1 /* Use the unit test allocators */
2 #define UNIT_TESTING 1
3 
4 #include <stdarg.h>
5 #include <stddef.h>
6 #include <setjmp.h>
7 #include <cmocka.h>
8 
9 static int group_setup_failing(void **state)
10 {
11  (void) state; /* unused */
12 
13  assert_int_equal(0, 1);
14 
15  return 0;
16 }
17 
18 static void test_true(void **state)
19 {
20  (void) state; /* unused */
21  assert_true(1);
22 }
23 
24 static void test_false(void **state)
25 {
26  (void) state; /* unused */
27  assert_false(0);
28 }
29 
30 int main(void) {
31  const struct CMUnitTest tests[] = {
34  };
35 
36  return cmocka_run_group_tests(tests, group_setup_failing, NULL);
37 }
#define assert_true(c)
Definition: cmocka.h:1045
#define cmocka_unit_test(f)
Initializes a CMUnitTest structure.
Definition: cmocka.h:1653
static void test_false(void **state)
static int group_setup_failing(void **state)
#define cmocka_run_group_tests(group_tests, group_setup, group_teardown)
Definition: cmocka.h:1749
int main(void)
static void test_true(void **state)
#define assert_false(c)
Definition: cmocka.h:1063
#define assert_int_equal(a, b)
Definition: cmocka.h:1174