git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9d3435b
)
talloc: testsuite add infrastructure to test aborts
author
Stefan Metzmacher
<metze@samba.org>
Tue, 14 Jul 2009 09:58:16 +0000
(11:58 +0200)
committer
Stefan Metzmacher
<metze@samba.org>
Tue, 14 Jul 2009 09:58:16 +0000
(11:58 +0200)
metze
lib/talloc/testsuite.c
patch
|
blob
|
history
diff --git
a/lib/talloc/testsuite.c
b/lib/talloc/testsuite.c
index ebcdac05f8ff1ba9e84d0ec8da0a4903124ceb6d..6057fc11c5fea4317495957d0596c9f2a37d5cbe 100644
(file)
--- a/
lib/talloc/testsuite.c
+++ b/
lib/talloc/testsuite.c
@@
-111,6
+111,25
@@
static double timeval_elapsed(struct timeval *tv)
} \
} while (0)
} \
} 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
/*
test references
@@
-1280,6
+1299,7
@@
static bool test_pool(void)
static void test_reset(void)
{
static void test_reset(void)
{
+ test_abort_stop();
talloc_disable_null_tracking();
talloc_enable_null_tracking();
}
talloc_disable_null_tracking();
talloc_enable_null_tracking();
}