From f4bcfcb1b91bfa6a568c4c99c2b3d16cd86090c6 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Fri, 6 Nov 2015 15:13:29 +0100 Subject: TESTS: Make check_leaks static function Reviewed-by: Petr Cech --- src/tests/common.h | 5 ----- src/tests/leak_check.c | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/tests/common.h b/src/tests/common.h index c0ceebfbf..ac9ba4026 100644 --- a/src/tests/common.h +++ b/src/tests/common.h @@ -34,11 +34,6 @@ extern TALLOC_CTX *global_talloc_context; -#define check_leaks(ctx, bytes) _check_leaks((ctx), (bytes), __location__) -bool _check_leaks(TALLOC_CTX *ctx, - size_t bytes, - const char *location); - void check_leaks_push(TALLOC_CTX *ctx); #define check_leaks_pop(ctx) _check_leaks_pop((ctx), __location__) diff --git a/src/tests/leak_check.c b/src/tests/leak_check.c index 79c8f05f6..fa153eb54 100644 --- a/src/tests/leak_check.c +++ b/src/tests/leak_check.c @@ -50,8 +50,8 @@ const char *check_leaks_err_msg(void) return leak_err_msg; } -bool -_check_leaks(TALLOC_CTX *ctx, size_t bytes, const char *location) +static bool +check_leaks(TALLOC_CTX *ctx, size_t bytes, const char *location) { size_t bytes_allocated; @@ -110,7 +110,7 @@ _check_leaks_pop(TALLOC_CTX *ctx, const char *location) } talloc_zfree(snapshot); - return _check_leaks(old_ctx, bytes_allocated, location); + return check_leaks(old_ctx, bytes_allocated, location); } bool @@ -140,7 +140,7 @@ leak_check_teardown(void) _set_leak_err_msg("Exiting with a non-empty stack"); return false; } - res = check_leaks(global_talloc_context, 0); + res = check_leaks(global_talloc_context, 0, __location__); talloc_disable_null_tracking(); talloc_free(global_talloc_context); return res; -- cgit