From 6913fd67ae09470399ccd8ba1ec3d4b2d58fb4d5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 14 Jul 2009 11:58:16 +0200 Subject: [PATCH] talloc: testsuite add infrastructure to test aborts metze --- lib/talloc/testsuite.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c index ebcdac05f8ff..6057fc11c5fe 100644 --- a/lib/talloc/testsuite.c +++ b/lib/talloc/testsuite.c @@ -111,6 +111,25 @@ static double timeval_elapsed(struct timeval *tv) } \ } while (0) +static unsigned int test_abort_count; + +static void test_abort_fn(const char *reason) +{ + printf("# test_abort_fn(%s)\n", reason); + test_abort_count++; +} + +static void test_abort_start(void) +{ + test_abort_count = 0; + talloc_set_abort_fn(test_abort_fn); +} + +static void test_abort_stop(void) +{ + test_abort_count = 0; + talloc_set_abort_fn(NULL); +} /* test references @@ -1280,6 +1299,7 @@ static bool test_pool(void) static void test_reset(void) { + test_abort_stop(); talloc_disable_null_tracking(); talloc_enable_null_tracking(); } -- 2.34.1