]> git.ipfire.org Git - thirdparty/kmod.git/commit
testsuite: use ARRAY_SIZE() for iteration
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 13 Jun 2025 18:48:18 +0000 (19:48 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Mon, 16 Jun 2025 12:37:42 +0000 (07:37 -0500)
commit5cecea47dc4f1493fc905281c53e4071d2838057
tree0512bb3a0a36facb229ade33b1cf8bb88ef71d8e
parentdb92629b4f1187d7970a2eb4f20686127b1275b5
testsuite: use ARRAY_SIZE() for iteration

Currently we use a mix of ARRAY_SIZE() and iterator pointer, where the
latter needs an extra instance for the NULL sentinel. Plus as evidenced
by the EXIT_SUCCESS -> EXIT_FAILURE changes in test-new-module - is
error prone.

Consistently use ARRAY_SIZE(), fixing the logical error in the test
which was flagged by ASan as memory leak :-)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/371
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
testsuite/test-blacklist.c
testsuite/test-new-module.c
testsuite/test-util.c
testsuite/test-weakdep.c