summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-11-19 10:15:18 +0100
committerGitHub <noreply@github.com>2024-11-19 10:15:18 +0100
commit574a04f62ac5113c028971a430f89fab479f5618 (patch)
tree33fc6658c367170e1b1979202bec5e1db678239c
parentvmspawn: enable memory pressure logic for vmspawn (diff)
parentstyle: Fix formatting (diff)
downloadsystemd-574a04f62ac5113c028971a430f89fab479f5618.tar.xz
systemd-574a04f62ac5113c028971a430f89fab479f5618.zip
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.
-rwxr-xr-xsrc/test/generate-sym-test.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/generate-sym-test.py b/src/test/generate-sym-test.py
index 028d108bb5..2e5177c934 100755
--- a/src/test/generate-sym-test.py
+++ b/src/test/generate-sym-test.py
@@ -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;