[libblockdev 2/2] Add some tests for the maximum representable size.
mulhern
amulhern at redhat.com
Wed Sep 3 02:13:15 UTC 2014
Signed-off-by: mulhern <amulhern at redhat.com>
---
src/utils/test_sizes.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/utils/test_sizes.c b/src/utils/test_sizes.c
index 805cd40..ce42e26 100644
--- a/src/utils/test_sizes.c
+++ b/src/utils/test_sizes.c
@@ -20,6 +20,18 @@ int main () {
human = bd_utils_size_human_readable ((16.4356 GiB));
puts (human);
g_free(human);
+ human = bd_utils_size_human_readable ((15 EiB));
+ puts (human);
+ g_free(human);
+ human = bd_utils_size_human_readable (G_MAXUINT64);
+ puts (human);
+ g_free(human);
+ human = bd_utils_size_human_readable (G_MAXUINT64 - 0xfffffffffffffffU);
+ puts (human);
+ g_free(human);
+ human = bd_utils_size_human_readable (G_MAXUINT64 - 0x7ffffffffffffffU);
+ 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