2010-12-28 18:57:02 +01:00
|
|
|
#define LIBSSH_STATIC
|
|
|
|
|
2017-10-28 14:31:37 +02:00
|
|
|
#include "config.h"
|
|
|
|
|
2010-12-28 18:57:02 +01:00
|
|
|
#include "torture.h"
|
|
|
|
#include "sftp.c"
|
|
|
|
|
|
|
|
static void torture_sftp_ext_new(void **state) {
|
|
|
|
sftp_ext x;
|
|
|
|
|
|
|
|
(void) state;
|
|
|
|
|
|
|
|
x = sftp_ext_new();
|
2019-01-15 13:45:10 +01:00
|
|
|
assert_non_null(x);
|
2010-12-28 18:57:02 +01:00
|
|
|
assert_int_equal(x->count, 0);
|
2019-01-15 13:45:10 +01:00
|
|
|
assert_null(x->name);
|
|
|
|
assert_null(x->data);
|
2010-12-28 18:57:02 +01:00
|
|
|
|
|
|
|
sftp_ext_free(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
int torture_run_tests(void) {
|
2011-01-03 08:46:14 +01:00
|
|
|
int rc;
|
2015-09-07 10:39:51 +02:00
|
|
|
struct CMUnitTest tests[] = {
|
|
|
|
cmocka_unit_test(torture_sftp_ext_new),
|
2010-12-28 18:57:02 +01:00
|
|
|
};
|
|
|
|
|
2011-01-03 09:02:34 +01:00
|
|
|
ssh_init();
|
|
|
|
|
2014-09-02 09:07:17 +02:00
|
|
|
torture_filter_tests(tests);
|
2015-09-07 10:39:51 +02:00
|
|
|
rc = cmocka_run_group_tests(tests, NULL, NULL);
|
2011-01-03 08:46:14 +01:00
|
|
|
ssh_finalize();
|
|
|
|
|
|
|
|
return rc;
|
2010-12-28 18:57:02 +01:00
|
|
|
}
|