Re: [PATCH 1/5] lib/tests: string_helpers: check null terminator too

From: Andy Shevchenko

Date: Thu Sep 17 2026 - 03:16:24 EST


On Wed, Sep 16, 2026 at 07:38:06PM +0200, Jonas Rebmann wrote:
> string_unescape() returns the number of character written to dst, not
> counting the null terminator which is always written.
>
> Ensure string_unescape has included the null terminator by adding a
> separate check.

...

> - KUNIT_ASSERT_EQ_MSG(test, q_real, q_test, "name:%s", name);
> + KUNIT_EXPECT_EQ_MSG(test, q_real, q_test, "name:%s", name);
> char *out_test, size_t q_test)

The commit message doesn't explain why it's safe to continue the test if the
first assertion fails. Care to elaborate?

--
With Best Regards,
Andy Shevchenko