From e4d0304b21d589414afc39cca805b34c5af934a9 Mon Sep 17 00:00:00 2001
From: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Date: Fri, 27 Dec 2013 14:48:59 +0100
Subject: [PATCH] tests: Convert 'total' to double instead of float

Now that total is long casting to float may cause precision loss.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
---
 tests/misc-bdev-write.cc | 4 ++--
 tests/misc-fs-stress.cc  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/misc-bdev-write.cc b/tests/misc-bdev-write.cc
index c03ff0155..71947afe7 100644
--- a/tests/misc-bdev-write.cc
+++ b/tests/misc-bdev-write.cc
@@ -86,7 +86,7 @@ int main(int argc, char const *argv[])
     _stat_printer.stop();
 
     auto actual_test_duration = to_seconds(test_end - test_start);
-    printf("Wrote %.3f MB in %.2f s = %.3f Mb/s\n", (float) total / MB, actual_test_duration,
-            (float) total / MB / actual_test_duration);
+    printf("Wrote %.3f MB in %.2f s = %.3f Mb/s\n", (double) total / MB, actual_test_duration,
+            (double) total / MB / actual_test_duration);
     return 0;
 }
\ No newline at end of file
diff --git a/tests/misc-fs-stress.cc b/tests/misc-fs-stress.cc
index 4b5406581..745f3b717 100644
--- a/tests/misc-fs-stress.cc
+++ b/tests/misc-fs-stress.cc
@@ -78,8 +78,8 @@ int main(int argc, char const *argv[])
     _stat_printer.stop();
 
     auto actual_test_duration = to_seconds(test_end - test_start);
-    printf("Wrote %.3f MB in %.2f s = %.3f Mb/s\n", (float) total / MB, actual_test_duration,
-        (float)total / MB / actual_test_duration);
+    printf("Wrote %.3f MB in %.2f s = %.3f Mb/s\n", (double) total / MB, actual_test_duration,
+        (double) total / MB / actual_test_duration);
 
     printf("\n");
     print_distribution(samples);
-- 
GitLab