aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-12-28 18:57:02 +0100
committerAndreas Schneider <asn@cynapses.org>2010-12-28 22:14:47 +0100
commit361e37dc66b374b432f8db29f3169ab00fd0cd03 (patch)
treec740c457909b63aa03d1c7bb5e0089c79cd88aa5 /tests
parentdf55918a41cc8a994bfcb955bd6d8ca068f5f62f (diff)
downloadlibssh-361e37dc66b374b432f8db29f3169ab00fd0cd03.tar.gz
libssh-361e37dc66b374b432f8db29f3169ab00fd0cd03.tar.xz
libssh-361e37dc66b374b432f8db29f3169ab00fd0cd03.zip
tests: Added a torture_sftp_static test.
Diffstat (limited to 'tests')
-rw-r--r--tests/client/CMakeLists.txt3
-rw-r--r--tests/client/torture_sftp_static.c26
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/client/CMakeLists.txt b/tests/client/CMakeLists.txt
index f8c2d98e..d3bfc8f7 100644
--- a/tests/client/CMakeLists.txt
+++ b/tests/client/CMakeLists.txt
@@ -4,3 +4,6 @@ add_cmockery_test(torture_algorithms torture_algorithms.c ${TORTURE_LIBRARY})
add_cmockery_test(torture_auth torture_auth.c ${TORTURE_LIBRARY})
add_cmockery_test(torture_knownhosts torture_knownhosts.c ${TORTURE_LIBRARY})
add_cmockery_test(torture_proxycommand torture_proxycommand.c ${TORTURE_LIBRARY})
+if (WITH_SFTP)
+ add_cmockery_test(torture_sftp_static torture_sftp_static.c ${TORTURE_LIBRARY})
+endif (WITH_SFTP)
diff --git a/tests/client/torture_sftp_static.c b/tests/client/torture_sftp_static.c
new file mode 100644
index 00000000..c6cd9791
--- /dev/null
+++ b/tests/client/torture_sftp_static.c
@@ -0,0 +1,26 @@
+#define LIBSSH_STATIC
+
+#include "torture.h"
+#include "sftp.c"
+
+static void torture_sftp_ext_new(void **state) {
+ sftp_ext x;
+
+ (void) state;
+
+ x = sftp_ext_new();
+ assert_false(x == NULL);
+ assert_int_equal(x->count, 0);
+ assert_true(x->name == NULL);
+ assert_true(x->data == NULL);
+
+ sftp_ext_free(x);
+}
+
+int torture_run_tests(void) {
+ const UnitTest tests[] = {
+ unit_test(torture_sftp_ext_new),
+ };
+
+ return run_tests(tests);
+}