]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Incorrect conversion to double 18963/head
authoramitkuma <amitkuma@redhat.com>
Thu, 16 Nov 2017 12:00:21 +0000 (17:30 +0530)
committeramitkuma <amitkuma@redhat.com>
Thu, 16 Nov 2017 12:00:21 +0000 (17:30 +0530)
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 <amitkuma@redhat.com>
src/test/kv_store_bench.cc

index e64aa3618eaf5a3eeec5370ce25e3842ec123aaf..943be685032bfbf63ebf2b38a78910986dba9679 100644 (file)
@@ -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) {