tests FEATURE new tests of library intitialization
Mostly useless as part of the tests, there shouldn't
be any definitely lost memory. To check that even all
reachable memory was freed, one must run the binaries
with valgrind themselves.
diff --git a/tests/test_init_destroy_ssh_tls.c b/tests/test_init_destroy_ssh_tls.c
new file mode 100644
index 0000000..d492740
--- /dev/null
+++ b/tests/test_init_destroy_ssh_tls.c
@@ -0,0 +1,78 @@
+/**
+ * \file test_init_destroy_ssh_tls.c
+ * \author Michal Vasko <mvasko@cesnet.cz>
+ * \brief libnetconf2 tests - libssh with libssl/libcrypto init/destroy
+ *
+ * Copyright (c) 2015 CESNET, z.s.p.o.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name of the Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <setjmp.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <cmocka.h>
+#include <libyang/libyang.h>
+
+#include "config.h"
+#include <netconf.h>
+
+static int
+setup_ssh_tls(void **state)
+{
+ (void)state;
+
+ nc_ssh_tls_init();
+
+ return 0;
+}
+
+static int
+teardown_ssh_tls(void **state)
+{
+ (void)state;
+
+ nc_ssh_tls_destroy();
+
+ return 0;
+}
+
+static void
+test_dummy(void **state)
+{
+ (void)state;
+}
+
+int
+main(void)
+{
+ const struct CMUnitTest init_destroy[] = {
+ cmocka_unit_test_setup_teardown(test_dummy, setup_ssh_tls, teardown_ssh_tls)
+ };
+
+ return cmocka_run_group_tests(init_destroy, NULL, NULL);
+}
+