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_keytab.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_keytab.c')
-rw-r--r-- | src/tests/cmocka/test_copy_keytab.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/tests/cmocka/test_copy_keytab.c b/src/tests/cmocka/test_copy_keytab.c index a9f2161a2..1999de3bf 100644 --- a/src/tests/cmocka/test_copy_keytab.c +++ b/src/tests/cmocka/test_copy_keytab.c @@ -37,7 +37,7 @@ struct keytab_test_ctx { krb5_principal principal; }; -void setup_keytab(void **state) +static int setup_keytab(void **state) { struct keytab_test_ctx *test_ctx; krb5_error_code kerr; @@ -98,9 +98,10 @@ void setup_keytab(void **state) check_leaks_push(test_ctx); *state = test_ctx; + return 0; } -void teardown_keytab(void **state) +static int teardown_keytab(void **state) { int ret; struct keytab_test_ctx *test_ctx = talloc_get_type(*state, @@ -116,6 +117,7 @@ void teardown_keytab(void **state) assert_true(check_leaks_pop(test_ctx) == true); talloc_free(test_ctx); assert_true(leak_check_teardown()); + return 0; } void test_copy_keytab(void **state) @@ -292,13 +294,13 @@ int main(int argc, const char *argv[]) POPT_TABLEEND }; - const UnitTest tests[] = { - unit_test_setup_teardown(test_copy_keytab, - setup_keytab, teardown_keytab), - unit_test_setup_teardown(test_sss_krb5_kt_have_content, - setup_keytab, teardown_keytab), - unit_test_setup_teardown(test_copy_keytab_order, - setup_keytab, teardown_keytab), + const struct CMUnitTest tests[] = { + cmocka_unit_test_setup_teardown(test_copy_keytab, + setup_keytab, teardown_keytab), + cmocka_unit_test_setup_teardown(test_sss_krb5_kt_have_content, + setup_keytab, teardown_keytab), + cmocka_unit_test_setup_teardown(test_copy_keytab_order, + setup_keytab, teardown_keytab), }; /* Set debug level to invalid value so we can deside if -d 0 was used. */ @@ -322,7 +324,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; } |