diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-03-09 21:48:11 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-03-11 14:39:35 +0100 |
commit | 4e5e846de22407f825fe3b4040d79606818a2419 (patch) | |
tree | 99bf02588f00f39d29f0d2f9e3a439b65fd5d6c3 /src/tests/cmocka/test_copy_ccache.c | |
parent | 0aad066baeed6833cf061b71d72c6bbbb2d2b9e8 (diff) | |
download | sssd-4e5e846de22407f825fe3b4040d79606818a2419.tar.gz sssd-4e5e846de22407f825fe3b4040d79606818a2419.tar.xz sssd-4e5e846de22407f825fe3b4040d79606818a2419.zip |
tests: convert all unit tests to cmocka 1.0 or later
All tests now use the cmocka-1.0-compatible API.
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/tests/cmocka/test_copy_ccache.c')
-rw-r--r-- | src/tests/cmocka/test_copy_ccache.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/tests/cmocka/test_copy_ccache.c b/src/tests/cmocka/test_copy_ccache.c index c7a5573b8..711f8f0ab 100644 --- a/src/tests/cmocka/test_copy_ccache.c +++ b/src/tests/cmocka/test_copy_ccache.c @@ -39,7 +39,7 @@ struct ccache_test_ctx { krb5_principal server_principal; }; -void setup_ccache(void **state) +static int setup_ccache(void **state) { struct ccache_test_ctx *test_ctx; krb5_error_code kerr; @@ -131,9 +131,10 @@ void setup_ccache(void **state) *state = test_ctx; krb5_free_authdata(test_ctx->kctx, test_creds.authdata); + return 0; } -void teardown_ccache(void **state) +static int teardown_ccache(void **state) { int ret; struct ccache_test_ctx *test_ctx = talloc_get_type(*state, @@ -150,6 +151,7 @@ void teardown_ccache(void **state) assert_true(check_leaks_pop(test_ctx) == true); talloc_free(test_ctx); assert_true(leak_check_teardown()); + return 0; } void test_copy_ccache(void **state) @@ -206,9 +208,9 @@ int main(int argc, const char *argv[]) POPT_TABLEEND }; - const UnitTest tests[] = { - unit_test_setup_teardown(test_copy_ccache, - setup_ccache, teardown_ccache), + const struct CMUnitTest tests[] = { + cmocka_unit_test_setup_teardown(test_copy_ccache, + setup_ccache, teardown_ccache), }; /* Set debug level to invalid value so we can deside if -d 0 was used. */ @@ -232,7 +234,7 @@ int main(int argc, const char *argv[]) * they might not after a failed run. Remove the old db to be sure */ tests_set_cwd(); - rv = run_tests(tests); + rv = cmocka_run_group_tests(tests, NULL, NULL); return rv; } |