Re: [PATCH] selftests/pid_namespace: compute pid_max test limits dynamically

From: Bjoern Doebel

Date: Wed Apr 22 2026 - 15:45:23 EST


From: Bjoern Doebel <doebel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>

On Wed, Apr 22, 2026 at 03:00:12PM +0200, Pavel Tikhomirov wrote:
> Why 24? Since val is int and longest int is INT_MIN, which has 11 characters, so 12 should be enough.

That's true, changing it to buf[12].

> Maybe we can simplify things by using global variable instead of pushing
> argument everywhere?
>
> There is also FIXTURE_SETUP/TEST_F which can probably be combined with global variable
> too. Plus you can try to avoid calling pid_min() multiple times.

Done, thanks for pointing me at the right infrastructure.

Sending v2.

Bjoern




Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christof Hellmis, Andreas Stieger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597