From f2c004d1ae5d859fac515152b4a9033845f151ef Mon Sep 17 00:00:00 2001 From: Roman Khavronenko Date: Thu, 20 Aug 2020 22:27:37 +0100 Subject: [PATCH] lib/flagutil: avoid int overflow for arch 386 (#710) Arch 386 is a 32-bit architecture and interprets int type for numbers as an explicit int32, whereas on most modern CPUs int is implicitly an int64. This makes tests to fail with `int overflow` error. --- lib/flagutil/bytes_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/flagutil/bytes_test.go b/lib/flagutil/bytes_test.go index c3a7197298..5382b8f851 100644 --- a/lib/flagutil/bytes_test.go +++ b/lib/flagutil/bytes_test.go @@ -46,9 +46,9 @@ func TestBytesSetSuccess(t *testing.T) { f("1KiB", 1024) f("1.5kib", 1.5*1024) f("23MiB", 23*1024*1024) - f("5.25GiB", 5.25*1024*1024*1024) + f("0.25GiB", 0.25*1024*1024*1024) f("1KB", 1000) f("1.5kb", 1.5*1000) f("23MB", 23*1000*1000) - f("5.25GB", 5.25*1000*1000*1000) + f("0.25GB", 0.25*1000*1000*1000) }