mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 02:03:37 +08:00
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:
commit
574a04f62a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user