]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Unit-tests] Fix test framework leaking on successful checks under setup or teardown...
authorAndrey Volk <andywolk@gmail.com>
Sat, 23 Nov 2019 23:59:54 +0000 (03:59 +0400)
committerAndrey Volk <andywolk@gmail.com>
Mon, 25 Nov 2019 21:05:03 +0000 (01:05 +0400)
src/include/test/switch_fct.h

index f2de6920f7ae7f5390794989e1af7dc01440506e..ab70d882c5e0eee55672b4aa19effb92b26d8df2 100644 (file)
@@ -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_));                                              \
     }