diff options
author | Rob Pike <r@golang.org> | 2009-01-16 14:16:31 -0800 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2009-01-16 14:16:31 -0800 |
commit | 969365a06e210a3a3c969a99585e868aecc6af8a (patch) | |
tree | cd385f6db111dd90dcbaa1a2007e17ae50e043de /src/lib/net/ip_test.go | |
parent | cea97fbfc985cf2cbd110c00d2e436b776b271f8 (diff) | |
download | golang-969365a06e210a3a3c969a99585e868aecc6af8a.tar.gz |
casify linux syscall dependents, plus a few stragglers
R=rsc
DELTA=97 (0 added, 0 deleted, 97 changed)
OCL=22971
CL=22973
Diffstat (limited to 'src/lib/net/ip_test.go')
-rw-r--r-- | src/lib/net/ip_test.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/net/ip_test.go b/src/lib/net/ip_test.go index 131c84432..a6b6c6f2d 100644 --- a/src/lib/net/ip_test.go +++ b/src/lib/net/ip_test.go @@ -9,11 +9,11 @@ import ( "testing" ) -func IPv4(a, b, c, d byte) []byte { +func _IPv4(a, b, c, d byte) []byte { return []byte{ 0,0,0,0, 0,0,0,0, 0,0,255,255, a,b,c,d } } -func Equal(a []byte, b []byte) bool { +func isEqual(a []byte, b []byte) bool { if a == nil && b == nil { return true } @@ -28,25 +28,25 @@ func Equal(a []byte, b []byte) bool { return true } -type ParseIPTest struct { +type parseIPTest struct { in string; out []byte; } -var parseiptests = []ParseIPTest { - ParseIPTest{"127.0.1.2", IPv4(127, 0, 1, 2)}, - ParseIPTest{"127.0.0.1", IPv4(127, 0, 0, 1)}, - ParseIPTest{"127.0.0.256", nil}, - ParseIPTest{"abc", nil}, - ParseIPTest{"::ffff:127.0.0.1", IPv4(127, 0, 0, 1)}, - ParseIPTest{"2001:4860:0:2001::68", +var parseiptests = []parseIPTest { + parseIPTest{"127.0.1.2", _IPv4(127, 0, 1, 2)}, + parseIPTest{"127.0.0.1", _IPv4(127, 0, 0, 1)}, + parseIPTest{"127.0.0.256", nil}, + parseIPTest{"abc", nil}, + parseIPTest{"::ffff:127.0.0.1", _IPv4(127, 0, 0, 1)}, + parseIPTest{"2001:4860:0:2001::68", []byte{0x20,0x01, 0x48,0x60, 0,0, 0x20,0x01, 0,0, 0,0, 0,0, 0x00,0x68}}, - ParseIPTest{"::ffff:4a7d:1363", IPv4(74, 125, 19, 99)}, + parseIPTest{"::ffff:4a7d:1363", _IPv4(74, 125, 19, 99)}, } export func TestParseIP(t *testing.T) { for i := 0; i < len(parseiptests); i++ { tt := parseiptests[i]; - if out := ParseIP(tt.in); !Equal(out, tt.out) { + if out := ParseIP(tt.in); !isEqual(out, tt.out) { t.Errorf("ParseIP(%#q) = %v, want %v", tt.in, out, tt.out); } } |