1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
From: Mathias Gibbens <gibmat@debian.org>
Subject: Fix test failures on 32bit systems
diff --git a/ifaddr_test.go b/ifaddr_test.go
index 45a0cc7..2464eed 100644
--- a/ifaddr_test.go
+++ b/ifaddr_test.go
@@ -196,7 +196,7 @@ func TestIfAddrMath(t *testing.T) {
SockAddr: sockaddr.MustIPv4Addr("127.0.0.1/8"),
},
operation: "address",
- value: fmt.Sprintf("+%d", 0xff00ff03),
+ value: fmt.Sprintf("+%d", int64(0xff00ff03)),
expected: "126.0.255.4/8",
},
{
@@ -205,7 +205,7 @@ func TestIfAddrMath(t *testing.T) {
SockAddr: sockaddr.MustIPv4Addr("127.0.0.1/8"),
},
operation: "address",
- value: fmt.Sprintf("-%d", 0xff00ff04),
+ value: fmt.Sprintf("-%d", int64(0xff00ff04)),
expected: "127.255.0.253/8",
},
{
@@ -269,7 +269,7 @@ func TestIfAddrMath(t *testing.T) {
SockAddr: sockaddr.MustIPv4Addr("127.0.0.1/8"),
},
operation: "network",
- value: fmt.Sprintf("+%d", 0xff00ff03),
+ value: fmt.Sprintf("+%d", int64(0xff00ff03)),
expected: "127.0.255.3/8",
},
{
@@ -279,7 +279,7 @@ func TestIfAddrMath(t *testing.T) {
SockAddr: sockaddr.MustIPv4Addr("127.0.0.1/8"),
},
operation: "network",
- value: fmt.Sprintf("-%d", 0xff00ff04),
+ value: fmt.Sprintf("-%d", int64(0xff00ff04)),
expected: "127.255.0.252/8",
},
{
@@ -307,7 +307,7 @@ func TestIfAddrMath(t *testing.T) {
SockAddr: sockaddr.MustIPv6Addr("fe80::1/104"),
},
operation: "network",
- value: fmt.Sprintf("+%d", 0xff00ff03),
+ value: fmt.Sprintf("+%d", int64(0xff00ff03)),
expected: "fe80::ff03/104",
},
{
@@ -317,7 +317,7 @@ func TestIfAddrMath(t *testing.T) {
SockAddr: sockaddr.MustIPv6Addr("fe80::1/104"),
},
operation: "network",
- value: fmt.Sprintf("-%d", 0xff00ff04),
+ value: fmt.Sprintf("-%d", int64(0xff00ff04)),
expected: "fe80::ff:fc/104",
},
{
diff --git a/rfc_test.go b/rfc_test.go
index af669a4..a51e547 100644
--- a/rfc_test.go
+++ b/rfc_test.go
@@ -45,7 +45,7 @@ func TestIsRFC(t *testing.T) {
{
name: "invalid rfc",
sa: sockaddr.MustIPv4Addr("192.168.0.0/16"),
- rfcNum: 999999999999,
+ rfcNum: 999999,
result: false,
},
}
|