Re: [PATCH] lib/tests: convert test_memcat_p module to KUnit
From: Andrew Morton
Date: Fri Oct 30 2026 - 02:36:58 EST
On Wed, 14 Oct 2026 11:41:43 +0800 Wang Yibo <szwyb123@xxxxxxxxx> wrote:
> Move lib/test_memcat_p.c to lib/tests/memcat_p_kunit.c and convert it to
> use KUnit.
>
> This change switches the ad-hoc test code to standard KUnit test cases.
> The test data remains the same, but the verification logic is updated to
> use KUNIT_EXPECT_* macros. All allocations are made test managed, so the
> manual error unwinding paths and the empty module exit hook are no longer
> needed, and a failure now reports which element mismatched instead of a
> single pr_err() message.
>
> CONFIG_TEST_MEMCAT_P keeps its name so that the defconfigs enabling it
> stay valid; it now depends on KUNIT and defaults to KUNIT_ALL_TESTS, like
> the other lib KUnit tests. Those defconfigs already select KUNIT and
> KUNIT_ALL_TESTS, so they keep turning the test on unchanged.
Thanks. AI review asked a couple of questions:
https://sashiko.dev/#/patchset/20261014034143.551624-1-szwyb123@xxxxxxxxx