From 081dbb110834dc76ae8978a6dd85097382c8e364 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 30 May 2025 10:51:21 +1000 Subject: [PATCH] Silence potential divide by zero warning in qpmulti.c Coverity flagged a potential divide by zero error in collect in qpmulti.c when the elapsed time is zero but that is only called once the elapsed time is greater than or equal to RUNTIME (1/4 second) so INSIST this is the case. --- tests/bench/qpmulti.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/bench/qpmulti.c b/tests/bench/qpmulti.c index 07c151e6c6..248b740df4 100644 --- a/tests/bench/qpmulti.c +++ b/tests/bench/qpmulti.c @@ -756,6 +756,8 @@ collect(void *varg) { stats[mut].compactions += tp->compactions; } + INSIST(elapsed >= RUNTIME); + printf("%7.3f\t", RUNTIME / (double)NS_PER_SEC); printf("%7.3f\t", elapsed / (double)NS_PER_SEC); printf("%7.3f\t", load_time);