From: Ondřej Surý Date: Fri, 6 Oct 2023 08:06:36 +0000 (+0200) Subject: Use read number of items instead of raw array size in load_names X-Git-Tag: v9.19.18~51^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=81f48e11e4a6ed1dc30e66ca4d34bd95e40b33be;p=thirdparty%2Fbind9.git Use read number of items instead of raw array size in load_names The load_names benchmark expected the input CSV with domains would fill the whole item array and it would crash when the number of lines would be less than that. Fix the expectations by using the real number or lines read to calculate the array start and end position for each benchmark thread. --- diff --git a/tests/bench/load-names.c b/tests/bench/load-names.c index 7d5c8b004e2..752d7e8b58b 100644 --- a/tests/bench/load-names.c +++ b/tests/bench/load-names.c @@ -552,7 +552,7 @@ main(int argc, char *argv[]) { isc_mem_create(&mem); map = fun->new (mem); - size_t nitems = ARRAY_SIZE(item) / (nthreads + 1); + size_t nitems = lines / (nthreads + 1); isc_barrier_init(&barrier, nthreads);