>From 7e95820146c58e68d9cdf356198d18a3f748ff81 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Fri, 6 Nov 2015 15:13:29 +0100 Subject: [PATCH 4/5] TESTS: Make check_leaks static function --- 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 c0ceebfbf5d9277a422065fbe4ddfdd65c758de8..ac9ba40263fb9d253157c7d07c90dbba04484a74 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 79c8f05f6a3b9a1893d442af4aa67510f1e7a957..fa153eb543b0ed78559a30ac3ea6b1b78088fa9d 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; -- 2.5.0