mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-03-24 20:40:09 +09:00
tests: Added a torture_sftp_static test.
This commit is contained in:
@@ -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)
|
||||
|
||||
26
tests/client/torture_sftp_static.c
Normal file
26
tests/client/torture_sftp_static.c
Normal file
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user