OpenVPN
test_ordering_fail.c
Go to the documentation of this file.
1 #include "config.h"
2 
3 #include <stdarg.h>
4 #include <stddef.h>
5 #include <setjmp.h>
6 #include <cmocka.h>
7 #include <cmocka_private.h>
8 
9 static void mock_test_a_called(void)
10 {
12 }
13 
14 static void mock_test_b_called(void)
15 {
17 }
18 
19 static void mock_test_c_called(void)
20 {
22 }
23 
24 static void test_does_fail_for_unexpected_call(void **state)
25 {
26  (void)state;
29 
33 }
34 
35 static void test_does_fail_for_unmade_expected_call(void **state)
36 {
37  (void)state;
40 
42 }
43 
44 static void test_ordering_fails_out_of_order(void **state)
45 {
46  (void)state;
50 
52 }
53 
55 {
56  (void)state;
59 
62 }
63 
64 /* Primarily used to test error message */
66 {
67  (void)state;
70 
73 }
74 
75 static void test_fails_if_zero_count_used(void **state)
76 {
77  (void)state;
79 
81 }
82 
83 int main(void) {
84  const struct CMUnitTest tests[] = {
92  };
93 
94  return cmocka_run_group_tests(tests, NULL, NULL);
95 }
#define cmocka_unit_test(f)
Initializes a CMUnitTest structure.
Definition: cmocka.h:1653
static void test_ordering_fails_out_of_order(void **state)
int main(void)
static void mock_test_a_called(void)
static void mock_test_b_called(void)
#define expect_function_calls(function, times)
Definition: cmocka.h:1450
static void test_does_fail_for_unexpected_call(void **state)
static void test_fails_if_zero_count_used(void **state)
#define expect_function_call_any(function)
Definition: cmocka.h:1479
#define function_called()
Definition: cmocka.h:1434
static void mock_test_c_called(void)
#define expect_function_call(function)
Definition: cmocka.h:1465
static void test_ordering_fails_out_of_order_for_at_least_once_calls(void **state)
#define cmocka_run_group_tests(group_tests, group_setup, group_teardown)
Definition: cmocka.h:1749
static void test_does_fail_for_unmade_expected_call(void **state)
static void test_fails_out_of_order_if_no_calls_found_on_any(void **state)
#define ignore_function_calls(function)
Definition: cmocka.h:1493