Re: [PATCH 3/5] lib/tests: string_helpers: introduce test_string_unescape_one

From: Jonas Rebmann

Date: Thu Sep 17 2026 - 05:10:38 EST


On 2026-09-17 09:21, Andy Shevchenko wrote:
On Wed, Sep 16, 2026 at 07:38:08PM +0200, Jonas Rebmann wrote:
The existing test_string_unescape() function follows a complex procedure
where it, given a set of UNESCAPE flags, appends multiple test fragments
and predicts their unescape result for the chosen set of flags. Rename
test_string_unescape() to a more descriptive
test_string_unescape_combined

In preparation to add simple regression tests, introduce
test_string_unescape_one() which asserts on exactly one call to
string_unescape.

Add some tests for corner cases which already pass.

So, this is two-in-one patch change. Needs a split, but I'm not sure why
we even need this. Can't your case be incorporated into the existing
"combined" variant?

They can not be incorporated into the combined variant because that
makes it impossible to control the size of the destination buffer. This
can not be fixed because the idea of the combined test is that all test
strings are combined into one buffer. The bugs fixed in this series only
occur when the destination buffer is limited.

Furthermore, for the regression tests, I want each test tailored for a
specific case and when it fails, to show me which one failed.

I'll update the commit message and split the commit.

--
Pengutronix e.K. | Jonas Rebmann |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |