regress_dns: drop hack for event_debug_map_HT_GROW in leak tests

This commit is contained in:
Azat Khuzhin 2015-01-08 04:45:49 +03:00
parent 941faaed39
commit 3540a193b5

View File

@ -1788,8 +1788,14 @@ 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();
/* not mm_calloc: we don't want to mess with the count. */
@ -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: