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_nested_groups.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_nested_groups.c')
-rw-r--r-- | src/tests/cmocka/test_nested_groups.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/tests/cmocka/test_nested_groups.c b/src/tests/cmocka/test_nested_groups.c index ac1045f1d..4f748a170 100644 --- a/src/tests/cmocka/test_nested_groups.c +++ b/src/tests/cmocka/test_nested_groups.c @@ -37,9 +37,9 @@ #define TEST_ID_PROVIDER "ldap" #define new_test(test) \ - unit_test_setup_teardown(nested_groups_test_ ## test, \ - nested_groups_test_setup, \ - nested_groups_test_teardown) + cmocka_unit_test_setup_teardown(nested_groups_test_ ## test, \ + nested_groups_test_setup, \ + nested_groups_test_teardown) /* put users and groups under the same container so we can easily run the * same tests cases for several search base scenarios */ @@ -563,7 +563,7 @@ static void nested_groups_test_nested_chain_with_error(void **state) assert_int_equal(ret, EIO); } -void nested_groups_test_setup(void **state) +static int nested_groups_test_setup(void **state) { errno_t ret; struct nested_groups_test_ctx *test_ctx = NULL; @@ -609,11 +609,13 @@ void nested_groups_test_setup(void **state) ret = sdap_idmap_init(test_ctx, test_ctx->sdap_id_ctx, &test_ctx->idmap_ctx); assert_int_equal(ret, EOK); test_ctx->sdap_opts->idmap_ctx = test_ctx->idmap_ctx; + return 0; } -void nested_groups_test_teardown(void **state) +static int nested_groups_test_teardown(void **state) { talloc_zfree(*state); + return 0; } int main(int argc, const char *argv[]) @@ -630,7 +632,7 @@ int main(int argc, const char *argv[]) POPT_TABLEEND }; - const UnitTest tests[] = { + const struct CMUnitTest tests[] = { new_test(one_group_no_members), new_test(one_group_unique_members), new_test(one_group_dup_users), @@ -663,7 +665,7 @@ int main(int argc, const char *argv[]) test_dom_suite_cleanup(TESTS_PATH, TEST_CONF_DB, TEST_DOM_NAME); test_dom_suite_setup(TESTS_PATH); - rv = run_tests(tests); + rv = cmocka_run_group_tests(tests, NULL, NULL); if (rv == 0 && !no_cleanup) { test_dom_suite_cleanup(TESTS_PATH, TEST_CONF_DB, TEST_DOM_NAME); } |