[libblockdev 2/3] Add a test for the maximum representable size.

mulhern amulhern at redhat.com
Wed Sep 3 15:41:32 UTC 2014


Signed-off-by: mulhern <amulhern at redhat.com>
---
 src/utils/test_sizes.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/utils/test_sizes.c b/src/utils/test_sizes.c
index 805cd40..064df90 100644
--- a/src/utils/test_sizes.c
+++ b/src/utils/test_sizes.c
@@ -20,6 +20,10 @@ int main () {
     human = bd_utils_size_human_readable ((16.4356 GiB));
     puts (human);
     g_free(human);
+    /* G_MAXUINT64 = 2^64 - 1 which is less by one than 16 EiB. */
+    human = bd_utils_size_human_readable (G_MAXUINT64);
+    puts (human);
+    g_free(human);
 
     g_printf ("10 KiB == %"G_GUINT64_FORMAT"\n", bd_utils_size_from_spec ("10 KiB", &error_message));
     if (error_message)
-- 
1.9.3



More information about the anaconda-patches mailing list