test: fix generate-sym-test using the wrong array (#35185)

For my understanding bsearch is searching in the wrong array. Or, if
it's the right one, then the size is wrong. In another commit I made the
arrays different by mistake and that triggered a SIGSEV during tests.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2024-11-19 10:15:18 +01:00 committed by GitHub
commit 574a04f62a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,15 +99,15 @@ int main(void) {
printf("Found %zu symbols from source files.\\n", j);
for (i = 0; symbols_from_sym[i].name; i++) {
struct symbol*n = bsearch(symbols_from_sym+i, symbols_from_source, sizeof(symbols_from_source)/sizeof(symbols_from_source[0])-1, sizeof(symbols_from_source[0]), sort_callback);
struct symbol *n = bsearch(symbols_from_sym+i, symbols_from_source, sizeof(symbols_from_source)/sizeof(symbols_from_source[0])-1, sizeof(symbols_from_source[0]), sort_callback);
if (!n)
printf("Found in symbol file, but not in sources: %s\\n", symbols_from_sym[i].name);
}
for (j = 0; symbols_from_source[j].name; j++) {
struct symbol*n = bsearch(symbols_from_source+j, symbols_from_source, sizeof(symbols_from_sym)/sizeof(symbols_from_sym[0])-1, sizeof(symbols_from_sym[0]), sort_callback);
struct symbol *n = bsearch(symbols_from_source+j, symbols_from_sym, sizeof(symbols_from_sym)/sizeof(symbols_from_sym[0])-1, sizeof(symbols_from_sym[0]), sort_callback);
if (!n)
printf("Found in sources, but not in symbol file: %s\\n", symbols_from_source[i].name);
printf("Found in sources, but not in symbol file: %s\\n", symbols_from_source[j].name);
}
return i == j ? EXIT_SUCCESS : EXIT_FAILURE;