Home GnuPG

tests/bench-slope: avoid divide by zero

Description

tests/bench-slope: avoid divide by zero

* tests/bench-slope.c (safe_div): New.
(get_slope): Make static; Skip if number of points is too small; Use
safe_div.
(do_slope_benchmark): Retry benchmark if result does not make sense;
Limit retries to 4 for non-auto-ghz and 1000 for auto-ghz.
(get_auto_ghz, do_slope_benchmark, bench_print_result_csv)
(bench_print_result_std): Use safe_div.
  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Oct 17 2021, 2:05 PM
Parents
rC5881114e0860: md: clear context with wipememory to avoid false warning
Branches
Unknown
Tags
Unknown