diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2015-01-06 16:32:16 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-01-30 12:40:40 +0100 |
commit | be73b26325bbd9c5a9bf34a32acfdf9b15bda531 (patch) | |
tree | 44f5077e9c74d618f677e5dec6e63b5b37176df9 /src | |
parent | 3cd7275c3c41a03eb65769c2bf4e472d1de7b8c0 (diff) | |
download | sssd-be73b26325bbd9c5a9bf34a32acfdf9b15bda531.tar.gz sssd-be73b26325bbd9c5a9bf34a32acfdf9b15bda531.tar.xz sssd-be73b26325bbd9c5a9bf34a32acfdf9b15bda531.zip |
TESTS: Mock return value of sdap_get_generic_recv
Reviewed-by: Pavel Reichl <preichl@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/cmocka/common_mock_sdap.c | 2 | ||||
-rw-r--r-- | src/tests/cmocka/test_nested_groups.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/tests/cmocka/common_mock_sdap.c b/src/tests/cmocka/common_mock_sdap.c index b2b57cbd2..4f6988c26 100644 --- a/src/tests/cmocka/common_mock_sdap.c +++ b/src/tests/cmocka/common_mock_sdap.c @@ -100,7 +100,7 @@ int sdap_get_generic_recv(struct tevent_req *req, *reply_count = sss_mock_type(size_t); *reply = sss_mock_ptr_type(struct sysdb_attrs **); - return EOK; + return sss_mock_type(int); } struct tevent_req * sdap_deref_search_send(TALLOC_CTX *mem_ctx, diff --git a/src/tests/cmocka/test_nested_groups.c b/src/tests/cmocka/test_nested_groups.c index 69033130f..c4ecb874e 100644 --- a/src/tests/cmocka/test_nested_groups.c +++ b/src/tests/cmocka/test_nested_groups.c @@ -177,11 +177,13 @@ static void nested_groups_test_one_group_unique_members(void **state) assert_non_null(user1_reply[0]); will_return(sdap_get_generic_recv, 1); will_return(sdap_get_generic_recv, user1_reply); + will_return(sdap_get_generic_recv, ERR_OK); user2_reply[0] = mock_sysdb_user(test_ctx, USER_BASE_DN, 2002, "user2"); assert_non_null(user2_reply[0]); will_return(sdap_get_generic_recv, 1); will_return(sdap_get_generic_recv, user2_reply); + will_return(sdap_get_generic_recv, ERR_OK); sss_will_return_always(sdap_has_deref_support, false); @@ -235,11 +237,13 @@ static void nested_groups_test_one_group_dup_users(void **state) assert_non_null(user1_reply[0]); will_return(sdap_get_generic_recv, 1); will_return(sdap_get_generic_recv, user1_reply); + will_return(sdap_get_generic_recv, ERR_OK); user2_reply[0] = mock_sysdb_user(test_ctx, USER_BASE_DN, 2001, "user1"); assert_non_null(user2_reply[0]); will_return(sdap_get_generic_recv, 1); will_return(sdap_get_generic_recv, user2_reply); + will_return(sdap_get_generic_recv, ERR_OK); sss_will_return_always(sdap_has_deref_support, false); @@ -297,12 +301,14 @@ static void nested_groups_test_one_group_unique_group_members(void **state) assert_non_null(group1_reply[0]); will_return(sdap_get_generic_recv, 1); will_return(sdap_get_generic_recv, group1_reply); + will_return(sdap_get_generic_recv, ERR_OK); group2_reply[0] = mock_sysdb_group_rfc2307bis(test_ctx, GROUP_BASE_DN, 1002, "emptygroup2", NULL); assert_non_null(group2_reply[0]); will_return(sdap_get_generic_recv, 1); will_return(sdap_get_generic_recv, group2_reply); + will_return(sdap_get_generic_recv, ERR_OK); sss_will_return_always(sdap_has_deref_support, false); @@ -358,12 +364,14 @@ static void nested_groups_test_one_group_dup_group_members(void **state) assert_non_null(group1_reply[0]); will_return(sdap_get_generic_recv, 1); will_return(sdap_get_generic_recv, group1_reply); + will_return(sdap_get_generic_recv, ERR_OK); group2_reply[0] = mock_sysdb_group_rfc2307bis(test_ctx, GROUP_BASE_DN, 1001, "emptygroup1", NULL); assert_non_null(group2_reply[0]); will_return(sdap_get_generic_recv, 1); will_return(sdap_get_generic_recv, group2_reply); + will_return(sdap_get_generic_recv, ERR_OK); sss_will_return_always(sdap_has_deref_support, false); |