From 4b6ad53a60b7f13ff440075f3b08bb1ebc765b53 Mon Sep 17 00:00:00 2001 From: yangfl Date: Sun, 29 Mar 2020 13:15:19 +0800 Subject: [PATCH] testsuite: fix compilation faliure on 32-bit systems error was: ./testsuite_cli_test.go:71:48: constant 2147483648 overflows int ./testsuite_cli_test.go:72:50: constant 4294967296 overflows int --- testsuite_cli_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite_cli_test.go b/testsuite_cli_test.go index 34d056d..0c2ebb2 100644 --- a/testsuite_cli_test.go +++ b/testsuite_cli_test.go @@ -68,8 +68,8 @@ func TestCli(t *testing.T) { memTotal, swapTotal := parseMeminfo() mem1percent := fmt.Sprintf("%d", memTotal*1/100) swap2percent := fmt.Sprintf("%d", swapTotal*2/100) - tooBigInt32 := fmt.Sprintf("%d", math.MaxInt32+1) - tooBigUint32 := fmt.Sprintf("%d", math.MaxUint32+1) + tooBigInt32 := fmt.Sprintf("%d", uint64(math.MaxInt32+1)) + tooBigUint32 := fmt.Sprintf("%d", uint64(math.MaxUint32+1)) // earlyoom startup looks like this: // earlyoom v1.1-5-g74a364b-dirty // mem total: 7836 MiB, min: 783 MiB (10 %)