[PATCH i-g-t v3 04/10] tests/intel/xe_drm_fdinfo: Use igt_assert_lt_double()
Nirmoy Das
nirmoy.das at linux.intel.com
Wed Aug 28 14:48:19 UTC 2024
On 8/27/2024 6:54 PM, Lucas De Marchi wrote:
> This also shows the value that is failing, which helps debugging.
>
> Cc: Matt Roper <matthew.d.roper at intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das at intel.com>
> ---
> tests/intel/xe_drm_fdinfo.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/tests/intel/xe_drm_fdinfo.c b/tests/intel/xe_drm_fdinfo.c
> index 074a89711..1b5980752 100644
> --- a/tests/intel/xe_drm_fdinfo.c
> +++ b/tests/intel/xe_drm_fdinfo.c
> @@ -485,10 +485,12 @@ check_results(struct pceu_cycles *s1, struct pceu_cycles *s2,
>
> igt_debug("%s: percent: %f\n", engine_map[class], percent);
>
> - if (flags & TEST_BUSY)
> - igt_assert(percent >= 95 && percent <= 105);
> - else
> + if (flags & TEST_BUSY) {
> + igt_assert_lt_double(95.0, percent);
> + igt_assert_lt_double(percent, 105.0);
> + } else {
> igt_assert(!percent);
> + }
> }
>
> static void
More information about the igt-dev
mailing list