From c16e41245ebaf426a5ad27ebe82597647c7743a3 Mon Sep 17 00:00:00 2001 From: Srini Brahmaroutu Date: Wed, 17 Dec 2014 22:33:50 +0000 Subject: [PATCH] Fix to avoid a compile error due to float to int truncation with GCCGO Signed-off-by: Srini Brahmaroutu --- pkg/units/size_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/units/size_test.go b/pkg/units/size_test.go index 5b329fcf68..3e410b0db8 100644 --- a/pkg/units/size_test.go +++ b/pkg/units/size_test.go @@ -23,9 +23,9 @@ func TestHumanSize(t *testing.T) { assertEquals(t, "1 MB", HumanSize(1000000)) assertEquals(t, "1.049 MB", HumanSize(1048576)) assertEquals(t, "2 MB", HumanSize(2*MB)) - assertEquals(t, "3.42 GB", HumanSize(3.42*GB)) - assertEquals(t, "5.372 TB", HumanSize(5.372*TB)) - assertEquals(t, "2.22 PB", HumanSize(2.22*PB)) + assertEquals(t, "3.42 GB", HumanSize(int64(float64(3.42*GB)))) + assertEquals(t, "5.372 TB", HumanSize(int64(float64(5.372*TB)))) + assertEquals(t, "2.22 PB", HumanSize(int64(float64(2.22*PB)))) } func TestFromHumanSize(t *testing.T) {