summaryrefslogtreecommitdiff
path: root/tests/unit_tests/openvpn/test_packet_id.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests/openvpn/test_packet_id.c')
-rw-r--r--tests/unit_tests/openvpn/test_packet_id.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/tests/unit_tests/openvpn/test_packet_id.c b/tests/unit_tests/openvpn/test_packet_id.c
index ba420c4..52bceb0 100644
--- a/tests/unit_tests/openvpn/test_packet_id.c
+++ b/tests/unit_tests/openvpn/test_packet_id.c
@@ -49,9 +49,10 @@ struct test_packet_id_write_data {
};
static int
-test_packet_id_write_setup(void **state) {
+test_packet_id_write_setup(void **state)
+{
struct test_packet_id_write_data *data =
- calloc(1, sizeof(struct test_packet_id_write_data));
+ calloc(1, sizeof(struct test_packet_id_write_data));
if (!data)
{
@@ -66,7 +67,8 @@ test_packet_id_write_setup(void **state) {
}
static int
-test_packet_id_write_teardown(void **state) {
+test_packet_id_write_teardown(void **state)
+{
free(*state);
return 0;
}
@@ -155,20 +157,27 @@ test_packet_id_write_long_wrap(void **state)
}
int
-main(void) {
+main(void)
+{
const struct CMUnitTest tests[] = {
- cmocka_unit_test_setup_teardown(test_packet_id_write_short,
- test_packet_id_write_setup, test_packet_id_write_teardown),
- cmocka_unit_test_setup_teardown(test_packet_id_write_long,
- test_packet_id_write_setup, test_packet_id_write_teardown),
- cmocka_unit_test_setup_teardown(test_packet_id_write_short_prepend,
- test_packet_id_write_setup, test_packet_id_write_teardown),
- cmocka_unit_test_setup_teardown(test_packet_id_write_long_prepend,
- test_packet_id_write_setup, test_packet_id_write_teardown),
- cmocka_unit_test_setup_teardown(test_packet_id_write_short_wrap,
- test_packet_id_write_setup, test_packet_id_write_teardown),
- cmocka_unit_test_setup_teardown(test_packet_id_write_long_wrap,
- test_packet_id_write_setup, test_packet_id_write_teardown),
+ cmocka_unit_test_setup_teardown(test_packet_id_write_short,
+ test_packet_id_write_setup,
+ test_packet_id_write_teardown),
+ cmocka_unit_test_setup_teardown(test_packet_id_write_long,
+ test_packet_id_write_setup,
+ test_packet_id_write_teardown),
+ cmocka_unit_test_setup_teardown(test_packet_id_write_short_prepend,
+ test_packet_id_write_setup,
+ test_packet_id_write_teardown),
+ cmocka_unit_test_setup_teardown(test_packet_id_write_long_prepend,
+ test_packet_id_write_setup,
+ test_packet_id_write_teardown),
+ cmocka_unit_test_setup_teardown(test_packet_id_write_short_wrap,
+ test_packet_id_write_setup,
+ test_packet_id_write_teardown),
+ cmocka_unit_test_setup_teardown(test_packet_id_write_long_wrap,
+ test_packet_id_write_setup,
+ test_packet_id_write_teardown),
};
return cmocka_run_group_tests_name("packet_id tests", tests, NULL, NULL);