[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Test should not be run if setup function fails


On Wednesday 26 February 2014 16:42:58 Lukas Slebodnik wrote:
> ehlo,

Hi Lukas,

> Assertions are commonly used in setup function. If setup function fail
> test should not be executed, because it may result into unexpected behaviour
> (crash)
> 
> src/tests/cmocka/test_dp_opts.c:87: error: Failure!
> [  FAILED  ] opt_test_getset_int_opt_test_getset_setup
> [ RUN      ] opt_test_getset_int
> Segmentation fault (core dumped)
> 
> 
> There is a corner case:
>     1. malloc in setup function
>     2. setup function fail (assert)w
>     3. teardown will not be called (there will be memory leak)

sorry for the late reply. I've pushed your patches to master. Thank you very 
much for your contribution!


	-- andreas


-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx