From bd2ea56c49d34e741c26c2f0e16f6ed9517adfac Mon Sep 17 00:00:00 2001 From: amitkuma Date: Thu, 16 Nov 2017 17:30:21 +0530 Subject: [PATCH] test: Incorrect conversion to double Fixes the coverity issue: CID 1417062 (#1 of 1): Result is not floating-point (UNINTENDED_INTEGER_DIVISION) integer_division: Dividing integer expressions 100 and temp , and then converting the integer quotient to type double. Any remainder, or fractional part of the quotient, is ignored. Signed-off-by: Amit Kumar --- src/test/kv_store_bench.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/kv_store_bench.cc b/src/test/kv_store_bench.cc index e64aa3618ea..943be685032 100644 --- a/src/test/kv_store_bench.cc +++ b/src/test/kv_store_bench.cc @@ -117,7 +117,7 @@ int KvStoreBench::setup(int argc, const char** argv) { } else if (strcmp(args[i], "--cache-refresh") == 0) { auto temp = atoi(args[i+1]); assert (temp != 0); - cache_refresh = 100 / temp; + cache_refresh = 100 / (double)temp; } else if (strcmp(args[i], "-t") == 0) { max_ops_in_flight = atoi(args[i+1]); } else if (strcmp(args[i], "--clients") == 0) { -- 2.39.5