[libblockdev 2/2] Add some tests for the maximum representable size.

Vratislav Podzimek vpodzime at redhat.com
Wed Sep 3 13:21:13 UTC 2014


On Tue, 2014-09-02 at 22:13 -0400, mulhern wrote:
> 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)
ACK.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list