OpenVPN
test_group_setup_fail.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  return 1; /* To indicate the failure */
13 }
14 
15 static void test_true(void **state)
16 {
17  (void) state; /* unused */
18  assert_true(1);
19 }
20 
21 static void test_false(void **state)
22 {
23  (void) state; /* unused */
24  assert_false(0);
25 }
26 
27 int main(void) {
28  const struct CMUnitTest tests[] = {
31  };
32 
33  return cmocka_run_group_tests(tests, group_setup_failing, NULL);
34 }
#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)
#define cmocka_run_group_tests(group_tests, group_setup, group_teardown)
Definition: cmocka.h:1749
int main(void)
static void test_true(void **state)
static int group_setup_failing(void **state)
#define assert_false(c)
Definition: cmocka.h:1063