From: Andrey Volk Date: Sat, 23 Nov 2019 23:59:54 +0000 (+0400) Subject: [Unit-tests] Fix test framework leaking on successful checks under setup or teardown... X-Git-Tag: v1.10.2^2~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5836b9652ba9dce2e3fa8dc51b30388e3f3819a5;p=thirdparty%2Ffreeswitch.git [Unit-tests] Fix test framework leaking on successful checks under setup or teardown mode. Failed checks in these modes are noted and then freed, but not when passed. --- diff --git a/src/include/test/switch_fct.h b/src/include/test/switch_fct.h index f2de6920f7..ab70d882c5 100644 --- a/src/include/test/switch_fct.h +++ b/src/include/test/switch_fct.h @@ -3663,9 +3663,12 @@ with. If we fail a setup up, then we go directly to a teardown mode. */ fct_ts__add_test( \ fctkern_ptr__->ns.ts_curr, fctkern_ptr__->ns.curr_test \ ); \ + } else { \ + fct_test__del(fctkern_ptr__->ns.curr_test); \ + fctkern_ptr__->ns.curr_test = NULL; \ } \ } else { \ - switch_assert("invalid condition for fct_req!"); \ + switch_assert("invalid condition for fct_req!"); \ _fct_req((_CNDTN_)); \ }