summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2014-08-20 19:21:40 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-08-22 10:51:24 +0200
commitbf65fbdd8c3fecd38a66363c3517e7a2679b8186 (patch)
tree00747d98bf9e13932fde1f1fa0090693c5b28962
parente210ed5da220acebb6751db4466fe352de08eaeb (diff)
downloadsssd-bf65fbdd8c3fecd38a66363c3517e7a2679b8186.tar.gz
sssd-bf65fbdd8c3fecd38a66363c3517e7a2679b8186.tar.xz
sssd-bf65fbdd8c3fecd38a66363c3517e7a2679b8186.zip
responder-get-domains-tests: fix checking of leaks
global_talloc_context should not be NULL in tests. It should be initialised with function leak_check_setup otherwise memory leak will not be detected. check_leaks_pop should not be directly called for global_talloc_context. It is a purpose of function leak_check_teardown Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
-rw-r--r--src/tests/cmocka/test_responder_common.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tests/cmocka/test_responder_common.c b/src/tests/cmocka/test_responder_common.c
index 24bb54ff5..77437602b 100644
--- a/src/tests/cmocka/test_responder_common.c
+++ b/src/tests/cmocka/test_responder_common.c
@@ -88,8 +88,7 @@ void parse_inp_test_setup(void **state)
{
struct parse_inp_test_ctx *parse_inp_ctx;
- check_leaks_push(global_talloc_context);
-
+ assert_true(leak_check_setup());
parse_inp_ctx = talloc_zero(global_talloc_context, struct parse_inp_test_ctx);
assert_non_null(parse_inp_ctx);
@@ -119,7 +118,7 @@ void parse_inp_test_teardown(void **state)
assert_true(check_leaks_pop(parse_inp_ctx) == true);
talloc_free(parse_inp_ctx);
- assert_true(check_leaks_pop(global_talloc_context) == true);
+ assert_true(leak_check_teardown());
}
int __real_sss_parse_name_for_domains(TALLOC_CTX *memctx,