From 81f48e11e4a6ed1dc30e66ca4d34bd95e40b33be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Fri, 6 Oct 2023 10:06:36 +0200 Subject: [PATCH] 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. --- tests/bench/load-names.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bench/load-names.c b/tests/bench/load-names.c index 7d5c8b004e..752d7e8b58 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);