mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-31 00:03:07 +03:00
tests: Migrated torture_init to cmockery.
This commit is contained in:
@ -2,7 +2,7 @@ project(unittests C)
|
|||||||
|
|
||||||
add_cmockery_test(torture_buffer torture_buffer.c ${TORTURE_LIBRARY})
|
add_cmockery_test(torture_buffer torture_buffer.c ${TORTURE_LIBRARY})
|
||||||
add_cmockery_test(torture_callbacks torture_callbacks.c ${TORTURE_LIBRARY})
|
add_cmockery_test(torture_callbacks torture_callbacks.c ${TORTURE_LIBRARY})
|
||||||
#add_check_test(torture_init torture_init.c ${TORTURE_LIBRARY})
|
add_cmockery_test(torture_init torture_init.c ${TORTURE_LIBRARY})
|
||||||
#add_check_test(torture_keyfiles torture_keyfiles.c ${TORTURE_LIBRARY})
|
#add_check_test(torture_keyfiles torture_keyfiles.c ${TORTURE_LIBRARY})
|
||||||
#add_check_test(torture_knownhosts torture_knownhosts.c ${TORTURE_LIBRARY})
|
#add_check_test(torture_knownhosts torture_knownhosts.c ${TORTURE_LIBRARY})
|
||||||
#add_check_test(torture_list torture_list.c ${TORTURE_LIBRARY})
|
#add_check_test(torture_list torture_list.c ${TORTURE_LIBRARY})
|
||||||
|
@ -1,25 +1,23 @@
|
|||||||
#define LIBSSH_STATIC
|
#define LIBSSH_STATIC
|
||||||
#include <libssh/libssh.h>
|
|
||||||
#include "libssh/priv.h"
|
|
||||||
#include "torture.h"
|
#include "torture.h"
|
||||||
|
#include "init.c"
|
||||||
|
|
||||||
START_TEST (torture_ssh_init)
|
static void torture_ssh_init(void **state) {
|
||||||
{
|
|
||||||
int rc;
|
int rc;
|
||||||
rc=ssh_init();
|
|
||||||
ck_assert_int_eq(rc,SSH_OK);
|
|
||||||
rc=ssh_finalize();
|
|
||||||
ck_assert_int_eq(rc,SSH_OK);
|
|
||||||
}
|
|
||||||
END_TEST
|
|
||||||
|
|
||||||
Suite *torture_make_suite(void) {
|
(void) state;
|
||||||
Suite *s = suite_create("libssh_init");
|
|
||||||
|
|
||||||
torture_create_case(s, "torture_ssh_init", torture_ssh_init);
|
rc = ssh_init();
|
||||||
|
assert_int_equal(rc, SSH_OK);
|
||||||
return s;
|
rc = ssh_finalize();
|
||||||
|
assert_int_equal(rc, SSH_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int torture_run_tests(void) {
|
||||||
|
const UnitTest tests[] = {
|
||||||
|
unit_test(torture_ssh_init),
|
||||||
|
};
|
||||||
|
|
||||||
|
return run_tests(tests);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user