summaryrefslogtreecommitdiffstats
path: root/server/Makefile.am
diff options
context:
space:
mode:
authorMartin Nagy <mnagy@redhat.com>2009-10-21 17:24:13 +0200
committerStephen Gallagher <sgallagh@redhat.com>2009-10-22 13:56:22 -0400
commitf0d7e2a1cacdffcbc84e5ad2bdd04f405dcaeb65 (patch)
treecec0473a3a3ebe6d2be1cfbfa46c7ef7aacf1232 /server/Makefile.am
parentb8565b19461efc67e4d10d8cafb5979412b4cad6 (diff)
downloadsssd-f0d7e2a1cacdffcbc84e5ad2bdd04f405dcaeb65.tar.gz
sssd-f0d7e2a1cacdffcbc84e5ad2bdd04f405dcaeb65.tar.xz
sssd-f0d7e2a1cacdffcbc84e5ad2bdd04f405dcaeb65.zip
Add a new set of helpful common functions for tests
The leak_check_setup() and leak_check_teardown() functions can be added to a test case with tcase_add_checked_fixture(). They will make sure that all tests are checked for memory leaks. However, since talloc is hierarchical and automatically frees the children, this will not catch all cases, but might still be helpful. The check_leaks(ctx, bytes) function takes a talloc context as an argument and the number of bytes it should be using up (children included). The total byte size used up by the context is determined by the talloc_total_size() function. If the size doesn't agree, check_leaks() will print out a talloc report on the context and makes the current test fail. The check_leaks_push() and check_leaks_pop() both take a talloc context as an argument. Every time push is called, the context is "pushed" onto an internal stack and it's current size is noted. When the context is later "poped", the pop function will make sure that the size is the same as when it was pushed. It will also check that it's not called out-of-order or if the stack isn't empty.
Diffstat (limited to 'server/Makefile.am')
-rw-r--r--server/Makefile.am3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/Makefile.am b/server/Makefile.am
index 81f438d36..a2c36874a 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -270,7 +270,8 @@ dist_noinst_HEADERS = \
tools/sss_sync_ops.h \
resolv/async_resolv.h \
resolv/ares/ares_parse_srv_reply.h \
- resolv/ares/ares_parse_txt_reply.h
+ resolv/ares/ares_parse_txt_reply.h \
+ tests/common.h
####################