Skip to content

Commit 0af3aac

Browse files
anakryikoborkmann
authored andcommitted
selftests/bpf: Don't truncate #test/subtest field
We currently expect up to a three-digit number of tests and subtests, so: #999/999: some_test/some_subtest: ... Is the largest test/subtest we can see. If we happen to cross into 1000s, current logic will just truncate everything after 7th character. This patch fixes this truncate and allows to go way higher (up to 31 characters in total). We still nicely align test numbers: #60/66 core_reloc_btfgen/type_based___incompat:OK #60/67 core_reloc_btfgen/type_based___fn_wrong_args:OK #60/68 core_reloc_btfgen/type_id:OK #60/69 core_reloc_btfgen/type_id___missing_targets:OK #60/70 core_reloc_btfgen/enumval:OK Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Jiri Olsa <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 46475cc commit 0af3aac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/bpf/test_progs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static void print_subtest_name(int test_num, int subtest_num,
255255
const char *test_name, char *subtest_name,
256256
char *result)
257257
{
258-
char test_num_str[TEST_NUM_WIDTH + 1];
258+
char test_num_str[32];
259259

260260
snprintf(test_num_str, sizeof(test_num_str), "%d/%d", test_num, subtest_num);
261261

0 commit comments

Comments
 (0)