summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-11-15 17:11:42 -0500
committerNick Mathewson <nickm@torproject.org>2011-11-15 17:11:42 -0500
commitb17b0eec02beb6d984f74096535bf4c706474b57 (patch)
treeea9a671286934fb46666e7bdd84f3933114c4447 /test
parente78741332985be96f2a44e71226b4adfe55aee7e (diff)
downloadlibevent-b17b0eec02beb6d984f74096535bf4c706474b57.tar.gz
Fix DNS memleak checks when running with malloc-replacement/debugging disabled
Diffstat (limited to 'test')
-rw-r--r--test/regress_dns.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/regress_dns.c b/test/regress_dns.c
index 512d58b5..b2ca47cb 100644
--- a/test/regress_dns.c
+++ b/test/regress_dns.c
@@ -1637,6 +1637,7 @@ gaic_launch(struct event_base *base, struct evdns_base *dns_base)
++pending;
}
+#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
/* FIXME: We should move this to regress_main.c if anything else needs it.*/
/* Trivial replacements for malloc/free/realloc to check for memory leaks.
@@ -1698,8 +1699,12 @@ testleak_cleanup(const struct testcase_t *testcase, void *env_)
{
int ok = 0;
struct testleak_env_t *env = env_;
+#ifdef _EVENT_DISABLE_DEBUG_MODE
+ tt_int_op(allocated_chunks, ==, 0);
+#else
/* FIXME: that's `1' because of event_debug_map_HT_GROW */
tt_int_op(allocated_chunks, ==, 1);
+#endif
ok = 1;
end:
if (env->dns_base)
@@ -1754,6 +1759,7 @@ test_dbg_leak_shutdown(void *env_)
event_base_free(env->base);
env->base = 0;
}
+#endif
static void
test_getaddrinfo_async_cancel_stress(void *ptr)
@@ -1832,8 +1838,10 @@ struct testcase_t dns_testcases[] = {
{ "getaddrinfo_cancel_stress", test_getaddrinfo_async_cancel_stress,
TT_FORK, NULL, NULL },
+#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
{ "leak_shutdown", test_dbg_leak_shutdown, TT_FORK, &testleak_funcs, NULL },
{ "leak_cancel", test_dbg_leak_cancel, TT_FORK, &testleak_funcs, NULL },
+#endif
END_OF_TESTCASES
};