[libcamera-devel] [PATCH 3/5] test: libtest: Return all non-zero init values

jacopo mondi jacopo at jmondi.org
Fri Dec 21 16:12:10 CET 2018


Hi Kieran,

On Fri, Dec 21, 2018 at 08:13:09AM +0000, Kieran Bingham wrote:
> A skipped test is currently defined as returning 77. If this is returned
> by the init stage, currently the execute call will continue on to the
> run stage.
>
> Correct this such that any non-zero return code from the init phase will
> abort the test.
>
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
>  test/libtest/test.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/libtest/test.cpp b/test/libtest/test.cpp
> index 1bb6ebcb9e8a..9d537ea08698 100644
> --- a/test/libtest/test.cpp
> +++ b/test/libtest/test.cpp
> @@ -20,7 +20,7 @@ int Test::execute()
>  	int ret;
>
>  	ret = init();
> -	if (ret < 0)
> +	if (ret)

To make this more explicit, what about ?
        if (ret != TEST_PASS)

Thanks
   j

>  		return ret;
>
>  	ret = run();
> --
> 2.17.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20181221/96ef4376/attachment.sig>


More information about the libcamera-devel mailing list