LEFT | RIGHT |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // This file implements API tests across platforms and will never have a build | 5 // This file implements API tests across platforms and will never have a build |
6 // tag. | 6 // tag. |
7 | 7 |
8 package net | 8 package net |
9 | 9 |
10 import ( | 10 import ( |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 }() | 169 }() |
170 | 170 |
171 c.WriteToUDP(wb, nil) | 171 c.WriteToUDP(wb, nil) |
172 c.WriteMsgUDP(wb, nil, nil) | 172 c.WriteMsgUDP(wb, nil, nil) |
173 } | 173 } |
174 | 174 |
175 func TestIPConnSpecificMethods(t *testing.T) { | 175 func TestIPConnSpecificMethods(t *testing.T) { |
176 switch runtime.GOOS { | 176 switch runtime.GOOS { |
177 case "plan9": | 177 case "plan9": |
178 t.Skipf("skipping test on %q", runtime.GOOS) | 178 t.Skipf("skipping test on %q", runtime.GOOS) |
179 » } | 179 » case "windows": |
180 » if os.Getuid() != 0 { | 180 » default: |
181 » » t.Skipf("skipping test; must be root") | 181 » » if os.Getuid() != 0 { |
| 182 » » » t.Skipf("skipping test; must be root") |
| 183 » » } |
182 } | 184 } |
183 | 185 |
184 la, err := ResolveIPAddr("ip4", "127.0.0.1") | 186 la, err := ResolveIPAddr("ip4", "127.0.0.1") |
185 if err != nil { | 187 if err != nil { |
186 t.Fatalf("ResolveIPAddr failed: %v", err) | 188 t.Fatalf("ResolveIPAddr failed: %v", err) |
187 } | 189 } |
188 c, err := ListenIP("ip4:icmp", la) | 190 c, err := ListenIP("ip4:icmp", la) |
189 if err != nil { | 191 if err != nil { |
190 t.Fatalf("ListenIP failed: %v", err) | 192 t.Fatalf("ListenIP failed: %v", err) |
191 } | 193 } |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 if p := recover(); p != nil { | 383 if p := recover(); p != nil { |
382 t.Fatalf("UnixConn.WriteToUnix or WriteMsgUnix panicked:
%v", p) | 384 t.Fatalf("UnixConn.WriteToUnix or WriteMsgUnix panicked:
%v", p) |
383 } | 385 } |
384 }() | 386 }() |
385 | 387 |
386 c1.WriteToUnix(wb, nil) | 388 c1.WriteToUnix(wb, nil) |
387 c1.WriteMsgUnix(wb, nil, nil) | 389 c1.WriteMsgUnix(wb, nil, nil) |
388 c3.WriteToUnix(wb, nil) | 390 c3.WriteToUnix(wb, nil) |
389 c3.WriteMsgUnix(wb, nil, nil) | 391 c3.WriteMsgUnix(wb, nil, nil) |
390 } | 392 } |
LEFT | RIGHT |