Re: [PATCH 2/2] kunit: string: add strnlen SIZE_MAX test coverage

From: gao.rui

Date: Thu Jul 23 2026 - 05:20:49 EST


> Extend string_test_strnlen to validate strnlen behavior with
> SIZE_MAX input:
> ...
> +            /* Test Count overflow fallback */
> +            KUNIT_EXPECT_EQ(test, strnlen(s, SSIZE_MAX), len);

On 2026/7/22 15:10, Feng Jiang wrote:
> A similar patch has already been submitted:
> https://lore.kernel.org/all/20260526085913.429049-1-min_halo@xxxxxxx/

Thanks for the pointer.

I checked that earlier patch, but it does not actually cover the **Count overflow** case.  
Specifically, it only tests with `SIZE_MAX`, while my patch adds an explicit case for `strnlen(s, SIZE_MAX)`.  


So my patch complements the existing one by extending KUnit coverage to this extreme input.

--

Best regards,  
Gao Rui