[Mesa-dev] [PATCH 2/2] i965: Test that nonrepresentable floats cannot be converted to VF.

Iago Toral itoral at igalia.com
Fri Nov 20 00:46:05 PST 2015


Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

On Thu, 2015-11-19 at 22:43 -0800, Matt Turner wrote:
> ---
>  src/mesa/drivers/dri/i965/test_vf_float_conversions.cpp | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/test_vf_float_conversions.cpp b/src/mesa/drivers/dri/i965/test_vf_float_conversions.cpp
> index 7f03425..7af97d0 100644
> --- a/src/mesa/drivers/dri/i965/test_vf_float_conversions.cpp
> +++ b/src/mesa/drivers/dri/i965/test_vf_float_conversions.cpp
> @@ -93,3 +93,18 @@ TEST_F(vf_float_conversion_test, test_special_case_0)
>     EXPECT_EQ(f2u(brw_vf_to_float(brw_float_to_vf(+0.0f))), f2u(+0.0f));
>     EXPECT_EQ(f2u(brw_vf_to_float(brw_float_to_vf(-0.0f))), f2u(-0.0f));
>  }
> +
> +TEST_F(vf_float_conversion_test, test_nonrepresentable_float_input)
> +{
> +   EXPECT_EQ(brw_float_to_vf(+32.0f), -1);
> +   EXPECT_EQ(brw_float_to_vf(-32.0f), -1);
> +
> +   EXPECT_EQ(brw_float_to_vf(+16.5f), -1);
> +   EXPECT_EQ(brw_float_to_vf(-16.5f), -1);
> +
> +   EXPECT_EQ(brw_float_to_vf(+8.25f), -1);
> +   EXPECT_EQ(brw_float_to_vf(-8.25f), -1);
> +
> +   EXPECT_EQ(brw_float_to_vf(+4.125f), -1);
> +   EXPECT_EQ(brw_float_to_vf(-4.125f), -1);
> +}




More information about the mesa-dev mailing list