blob: 93ce74f1f628430531fa0179669511e84db583c9 [file] [log] [blame]
Michal Vasko77fad152016-02-03 15:36:15 +01001/**
2 * \file test_init_destroy_tls.c
3 * \author Michal Vasko <mvasko@cesnet.cz>
4 * \brief libnetconf2 tests - libssl/libcrypto init/destroy
5 *
6 * Copyright (c) 2015 CESNET, z.s.p.o.
7 *
Radek Krejci9b81f5b2016-02-24 13:14:49 +01008 * This source code is licensed under BSD 3-Clause License (the "License").
9 * You may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * https://opensource.org/licenses/BSD-3-Clause
Michal Vasko77fad152016-02-03 15:36:15 +010013 */
14
15#include <errno.h>
16#include <fcntl.h>
17#include <pthread.h>
18#include <setjmp.h>
19#include <stdarg.h>
20#include <stddef.h>
21#include <stdint.h>
22#include <stdlib.h>
23#include <unistd.h>
24#include <string.h>
25#include <sys/stat.h>
26#include <sys/types.h>
27#include <sys/socket.h>
28
29#include <cmocka.h>
30#include <libyang/libyang.h>
31
32#include "config.h"
33#include <netconf.h>
34
35static int
36setup_tls(void **state)
37{
38 (void)state;
39
40 nc_tls_init();
41
42 return 0;
43}
44
45static int
46teardown_tls(void **state)
47{
48 (void)state;
49
50 nc_tls_destroy();
51
52 return 0;
53}
54
55static void
56test_dummy(void **state)
57{
58 (void)state;
59}
60
61int
62main(void)
63{
64 const struct CMUnitTest init_destroy[] = {
65 cmocka_unit_test_setup_teardown(test_dummy, setup_tls, teardown_tls)
66 };
67
68 return cmocka_run_group_tests(init_destroy, NULL, NULL);
69}
70