1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-29 13:01:13 +03:00

tests: Migrated torture_init to cmockery.

This commit is contained in:
Andreas Schneider
2010-12-28 14:15:32 +01:00
parent 400fc350a7
commit fa17f33d2b
2 changed files with 15 additions and 17 deletions

View File

@ -1,25 +1,23 @@
#define LIBSSH_STATIC
#include <libssh/libssh.h>
#include "libssh/priv.h"
#include "torture.h"
#include "init.c"
START_TEST (torture_ssh_init)
{
static void torture_ssh_init(void **state) {
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) {
Suite *s = suite_create("libssh_init");
(void) state;
torture_create_case(s, "torture_ssh_init", torture_ssh_init);
return s;
rc = ssh_init();
assert_int_equal(rc, SSH_OK);
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);
}