[Beignet] [PATCH 2/2] utests: don't continue to run any case when fail to initialize device.

Yang, Rong R rong.r.yang at intel.com
Mon Apr 13 21:21:25 PDT 2015


The patchset LGTM, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Zhigang Gong
> Sent: Tuesday, April 14, 2015 09:55
> To: beignet at lists.freedesktop.org
> Cc: Gong, Zhigang
> Subject: [Beignet] [PATCH 2/2] utests: don't continue to run any case when
> fail to initialize device.
> 
> Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
> ---
>  utests/utest_run.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/utests/utest_run.cpp b/utests/utest_run.cpp index
> d797c09..3cc1b6c 100644
> --- a/utests/utest_run.cpp
> +++ b/utests/utest_run.cpp
> @@ -58,7 +58,10 @@ int main(int argc, char *argv[])  {
> 
>    int c = 0;
> -  cl_ocl_init();
> +  if (cl_ocl_init() != CL_SUCCESS) {
> +    fprintf(stderr, "Failed to initialize cl device.\n");
> +    goto clean;
> +  }
> 
>    c = getopt_long (argc, argv, shortopts, longopts, NULL);
> 
> @@ -124,6 +127,7 @@ int main(int argc, char *argv[])
>      }
>    } while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1);
> 
> +clean:
>    cl_ocl_destroy();
>  }
> 
> --
> 1.9.1
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list