summaryrefslogtreecommitdiffstats
path: root/src/tests/cmocka/test_nested_groups.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2015-05-29 15:42:46 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-06-14 21:47:19 +0200
commitd43c9d18fb263b1ea4071b20e93ce4994583f62f (patch)
tree48a13f6a0427f5d3af4c7dcf4e967e191d12fa7f /src/tests/cmocka/test_nested_groups.c
parentb1a822a16e3ef97e31d167f9e97efec06fc121dc (diff)
downloadsssd-d43c9d18fb263b1ea4071b20e93ce4994583f62f.tar.gz
sssd-d43c9d18fb263b1ea4071b20e93ce4994583f62f.tar.xz
sssd-d43c9d18fb263b1ea4071b20e93ce4994583f62f.zip
TESTS: Add a common mock_be_ctx function
Reduces code duplication between tests. Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/tests/cmocka/test_nested_groups.c')
-rw-r--r--src/tests/cmocka/test_nested_groups.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tests/cmocka/test_nested_groups.c b/src/tests/cmocka/test_nested_groups.c
index 4f748a170..75fb3a19f 100644
--- a/src/tests/cmocka/test_nested_groups.c
+++ b/src/tests/cmocka/test_nested_groups.c
@@ -25,6 +25,7 @@
#include "tests/cmocka/common_mock.h"
#include "tests/cmocka/common_mock_sdap.h"
+#include "tests/cmocka/common_mock_be.h"
#include "tests/cmocka/common_mock_sysdb_objects.h"
#include "providers/ldap/ldap_common.h"
#include "providers/ldap/sdap.h"
@@ -599,12 +600,10 @@ static int nested_groups_test_setup(void **state)
struct sdap_id_ctx);
assert_non_null(test_ctx->sdap_id_ctx);
- test_ctx->sdap_id_ctx->be = talloc_zero(test_ctx->sdap_id_ctx,
- struct be_ctx);
+ test_ctx->sdap_id_ctx->be = mock_be_ctx(test_ctx, test_ctx->tctx);
assert_non_null(test_ctx->sdap_id_ctx->be);
test_ctx->sdap_id_ctx->opts = test_ctx->sdap_opts;
- test_ctx->sdap_id_ctx->be->domain = test_ctx->tctx->dom;
ret = sdap_idmap_init(test_ctx, test_ctx->sdap_id_ctx, &test_ctx->idmap_ctx);
assert_int_equal(ret, EOK);