summaryrefslogtreecommitdiff
path: root/lib/talloc/testsuite.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-07-14 11:58:16 +0200
committerAndrew Tridgell <tridge@samba.org>2009-08-24 16:29:57 +1000
commitf8559b8238409b28ba198c89e6a31e62cf28df88 (patch)
treed085d7117d7d8d8aa61c463bc29e00f5a4ade762 /lib/talloc/testsuite.c
parent13227f83b9efb549ae05a0b508095de288347386 (diff)
downloadsamba-f8559b8238409b28ba198c89e6a31e62cf28df88.tar.gz
samba-f8559b8238409b28ba198c89e6a31e62cf28df88.tar.bz2
samba-f8559b8238409b28ba198c89e6a31e62cf28df88.zip
talloc/testsuite: add infrastructure to test aborts
metze
Diffstat (limited to 'lib/talloc/testsuite.c')
-rw-r--r--lib/talloc/testsuite.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c
index 262228760a..2ee33287bd 100644
--- a/lib/talloc/testsuite.c
+++ b/lib/talloc/testsuite.c
@@ -99,6 +99,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
@@ -1109,6 +1128,7 @@ static bool test_pool(void)
static void test_reset(void)
{
+ test_abort_stop();
talloc_disable_null_tracking();
talloc_enable_null_tracking();
}