Re: [PATCH v2 3/9] ext4: Give the extents KUnit cases distinct names
From: David Gow
Date: Fri Nov 27 2026 - 04:04:37 EST
> The ext4_extents_test suite runs test_split_convert() against three
> different parameter arrays by listing it three times with
> KUNIT_CASE_PARAM_WITH_INIT(), which names each case after the function.
> All three cases are therefore called test_split_convert, so they cannot
> be told apart in the results.
>
> Use KUNIT_CASE_PARAM_WITH_INIT_UNIQUE() for these entries so that each
> case is also named for the param_init() function which registers its
> parameter array, for example
> test_split_convert-test_convert_initialized_param_init.
>
> Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
Note: This is probably going to have a conflict with all of the changes to
the ext4 tests which have just landed. It still applies cleanly to the
kselftest/kunit brach for the moment, though.
>
> diff --git a/fs/ext4/extents-test.c b/fs/ext4/extents-test.c
> index 2e997f228330..ebef078e292f 100644
> --- a/fs/ext4/extents-test.c
> +++ b/fs/ext4/extents-test.c
> @@ -1045,12 +1045,12 @@ static int test_handle_unwritten_init(struct kunit *test)
> * https://lore.kernel.org/linux-kselftest/aULJpTvJDw9ctUDe@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
> */
> static struct kunit_case extents_test_cases[] = {
> - KUNIT_CASE_PARAM_WITH_INIT(test_split_convert, kunit_array_gen_params,
> - test_split_convert_param_init, NULL),
> - KUNIT_CASE_PARAM_WITH_INIT(test_split_convert, kunit_array_gen_params,
> - test_convert_initialized_param_init, NULL),
> - KUNIT_CASE_PARAM_WITH_INIT(test_split_convert, kunit_array_gen_params,
> - test_handle_unwritten_init, NULL),
> + KUNIT_CASE_PARAM_WITH_INIT_UNIQUE(test_split_convert, kunit_array_gen_params,
> + test_split_convert_param_init, NULL),
> + KUNIT_CASE_PARAM_WITH_INIT_UNIQUE(test_split_convert, kunit_array_gen_params,
> + test_convert_initialized_param_init, NULL),
> + KUNIT_CASE_PARAM_WITH_INIT_UNIQUE(test_split_convert, kunit_array_gen_params,
> + test_handle_unwritten_init, NULL),
> {}
> };
>
Acked-by: David Gow <david@xxxxxxxxxxxx>
--
David Gow <david@xxxxxxxxxxxx>