OpenVPN
vendor
cmocka
tests
test_exception_handler.c
Go to the documentation of this file.
1
#include <stdarg.h>
2
#include <stddef.h>
3
#include <setjmp.h>
4
#include <
cmocka.h
>
5
6
#include <stdlib.h>
7
8
struct
test_segv
{
9
int
x
;
10
int
y
;
11
};
12
13
static
void
test_segfault_recovery
(
void
**state)
14
{
15
struct
test_segv
*s = NULL;
16
17
(void) state;
/* unused */
18
19
s->
x
= 1;
20
}
21
22
int
main
(
void
) {
23
const
struct
CMUnitTest
tests[] = {
24
cmocka_unit_test
(
test_segfault_recovery
),
25
cmocka_unit_test
(
test_segfault_recovery
),
26
cmocka_unit_test
(
test_segfault_recovery
),
27
};
28
29
return
cmocka_run_group_tests
(tests, NULL, NULL);
30
}
cmocka_unit_test
#define cmocka_unit_test(f)
Initializes a CMUnitTest structure.
Definition:
cmocka.h:1653
test_segv::y
int y
Definition:
test_exception_handler.c:10
test_segv::x
int x
Definition:
test_exception_handler.c:9
cmocka_run_group_tests
#define cmocka_run_group_tests(group_tests, group_setup, group_teardown)
Definition:
cmocka.h:1749
cmocka.h
CMUnitTest
Definition:
cmocka.h:2071
test_segv
Definition:
test_exception_handler.c:8
main
int main(void)
Definition:
test_exception_handler.c:22
test_segfault_recovery
static void test_segfault_recovery(void **state)
Definition:
test_exception_handler.c:13
Generated by
1.8.13