[PATCH i-g-t 1/2] tests/intel/xe_query: Fail on unknown hwconfig entries
Dixit, Ashutosh
ashutosh.dixit at intel.com
Fri Aug 2 23:12:59 UTC 2024
On Thu, 01 Aug 2024 12:51:28 -0700, John.C.Harrison at Intel.com wrote:
>
> From: John Harrison <John.C.Harrison at Intel.com>
>
> There is a test that the hwconfig table is valid. However, if there
> was an unknown entry (corrupted table or out of date test) all it did
> was print a debug message of "please fix"! So the test would still
> pass and CI would not notice the problem.
>
> Add in some actual asserts that the enum value is within the valid
> range and that it is not missing from the switch statement.
Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
>
> Signed-off-by: John Harrison <John.C.Harrison at Intel.com>
> ---
> tests/intel/xe_query.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/intel/xe_query.c b/tests/intel/xe_query.c
> index c6d88b258fb3..6ebf5e4b6d71 100644
> --- a/tests/intel/xe_query.c
> +++ b/tests/intel/xe_query.c
> @@ -137,7 +137,8 @@ const char* get_hwconfig_name(int param)
> CASE_STRINGIFY(MIN_MESH_URB_ENTRIES);
> CASE_STRINGIFY(MAX_MESH_URB_ENTRIES);
> }
> - return "?? Please fix "__FILE__;
> + igt_assert_lt(param, __INTEL_HWCONFIG_KEY_LIMIT);
> + igt_assert(!"Missing config table enum");
> }
> #undef CASE_STRINGIFY
>
> --
> 2.45.2
>
More information about the igt-dev
mailing list