summaryrefslogtreecommitdiffstats
path: root/src/tests/cwrap
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2015-10-24 15:39:21 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-11-11 12:10:43 +0100
commit9c62d6619b87f1255ef6515280a20552fca9d925 (patch)
treed3a7775292a0217124f5573a45be8bc48b6341da /src/tests/cwrap
parent5455da4f944145239295a2d8344f1a7602b4454d (diff)
downloadsssd-9c62d6619b87f1255ef6515280a20552fca9d925.tar.gz
sssd-9c62d6619b87f1255ef6515280a20552fca9d925.tar.xz
sssd-9c62d6619b87f1255ef6515280a20552fca9d925.zip
TESTS: Initialize leak check
If leak_check_setup is not called then global_talloc_context was not initialized and check_leaks_pop(global_talloc_context) will fail. Reviewed-by: Petr Cech <pcech@redhat.com>
Diffstat (limited to 'src/tests/cwrap')
-rw-r--r--src/tests/cwrap/test_become_user.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tests/cwrap/test_become_user.c b/src/tests/cwrap/test_become_user.c
index b9e8a5c3b..48e16d4c7 100644
--- a/src/tests/cwrap/test_become_user.c
+++ b/src/tests/cwrap/test_become_user.c
@@ -78,6 +78,8 @@ void test_switch_user(void **state)
struct sss_creds *saved_creds;
struct sss_creds *saved_creds2 = NULL;
+ assert_true(leak_check_setup());
+
check_leaks_push(global_talloc_context);
tmp_ctx = talloc_new(global_talloc_context);
assert_non_null(tmp_ctx);
@@ -121,6 +123,7 @@ void test_switch_user(void **state)
check_leaks_pop(tmp_ctx);
talloc_free(tmp_ctx);
check_leaks_pop(global_talloc_context);
+ assert_true(leak_check_teardown());
}
int main(int argc, const char *argv[])