[igt-dev] [PATCH i-g-t 10/21] tests/kms_color: Assert gamma look up table sizes

Arkadiusz Hiler arkadiusz.hiler at intel.com
Mon Jan 28 13:04:13 UTC 2019


On Wed, Jan 16, 2019 at 01:20:39PM +0200, Petri Latvala wrote:
> If the properties for gamma tables exist, their sizes must be
> non-zero.
> 
> Signed-off-by: Petri Latvala <petri.latvala at intel.com>
> Cc: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
>  tests/kms_color.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c
> index 913c70ca..decf3c2a 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -124,9 +124,13 @@ static void paint_rectangles(data_t *data,
>  
>  static double *generate_table(uint32_t lut_size, double exp)
>  {
> -	double *coeffs = malloc(sizeof(double) * lut_size);
> +	double *coeffs;
>  	uint32_t i;
>  
> +	igt_assert_lt(0, lut_size);

Asserts like that never parse well for me, especiall that
assert_gt(value, 0) seems to be overall more common...

Meybe we should introduce it to IGT?

Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>


More information about the igt-dev mailing list