From: Azat Khuzhin Date: Thu, 8 Jan 2015 01:45:49 +0000 (+0300) Subject: regress_dns: drop hack for event_debug_map_HT_GROW in leak tests X-Git-Tag: release-2.1.6-beta~98^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3540a193b5540ac72004b8f19fedf839d5cd71ad;p=libevent regress_dns: drop hack for event_debug_map_HT_GROW in leak tests --- diff --git a/test/regress_dns.c b/test/regress_dns.c index e03c143c..b91b31f1 100644 --- a/test/regress_dns.c +++ b/test/regress_dns.c @@ -1788,9 +1788,15 @@ testleak_setup(const struct testcase_t *testcase) struct testleak_env_t *env; allocated_chunks = 0; + + /* Reset allocation counter, to start allocations from the very beginning. + * (this will avoid false-positive negative numbers for allocated_chunks) + */ + libevent_global_shutdown(); + event_set_mem_functions(cnt_malloc, cnt_realloc, cnt_free); - if (!libevent_tests_running_in_debug_mode) - event_enable_debug_mode(); + + event_enable_debug_mode(); /* not mm_calloc: we don't want to mess with the count. */ env = calloc(1, sizeof(struct testleak_env_t)); @@ -1811,8 +1817,8 @@ testleak_cleanup(const struct testcase_t *testcase, void *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); + libevent_global_shutdown(); + tt_int_op(allocated_chunks, ==, 0); #endif ok = 1; end: