1
0
mirror of https://github.com/golang/go synced 2024-11-19 16:54:44 -07:00

net: skip some tests on Windows XP

Parts of TestUDPConnSpecificMethods and TestWriteToUDP fail, because
UDPConn.WriteMsgUDP is broken on Windows XP. UDPConn.WriteMsgUDP uses
Windows WSASendMsg API, but that call is not implemented on Windows XP (see
https://msdn.microsoft.com/en-us/library/windows/desktop/ms741692(v=vs.85).aspx
for details)

Update #23072

Change-Id: I4e8f149bc62bd87cd7c199e6832b9ce479af0a3e
Reviewed-on: https://go-review.googlesource.com/83077
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Alex Brainman 2017-12-10 10:35:44 +11:00 committed by Brad Fitzpatrick
parent d038da73bd
commit 607147d000
2 changed files with 20 additions and 5 deletions

View File

@ -8,6 +8,7 @@
package net
import (
"internal/testenv"
"os"
"runtime"
"testing"
@ -138,11 +139,15 @@ func TestUDPConnSpecificMethods(t *testing.T) {
if _, _, err := c.ReadFromUDP(rb); err != nil {
t.Fatal(err)
}
if _, _, err := c.WriteMsgUDP(wb, nil, c.LocalAddr().(*UDPAddr)); err != nil {
condFatalf(t, c.LocalAddr().Network(), "%v", err)
}
if _, _, _, _, err := c.ReadMsgUDP(rb, nil); err != nil {
condFatalf(t, c.LocalAddr().Network(), "%v", err)
if testenv.IsWindowsXP() {
t.Log("skipping broken test on Windows XP (see golang.org/issue/23072)")
} else {
if _, _, err := c.WriteMsgUDP(wb, nil, c.LocalAddr().(*UDPAddr)); err != nil {
condFatalf(t, c.LocalAddr().Network(), "%v", err)
}
if _, _, _, _, err := c.ReadMsgUDP(rb, nil); err != nil {
condFatalf(t, c.LocalAddr().Network(), "%v", err)
}
}
if f, err := c.File(); err != nil {

View File

@ -163,6 +163,11 @@ func testWriteToConn(t *testing.T, raddr string) {
switch runtime.GOOS {
case "nacl": // see golang.org/issue/9252
t.Skipf("not implemented yet on %s", runtime.GOOS)
case "windows":
if testenv.IsWindowsXP() {
t.Log("skipping broken test on Windows XP (see golang.org/issue/23072)")
return
}
default:
if err != nil {
t.Fatal(err)
@ -206,6 +211,11 @@ func testWriteToPacketConn(t *testing.T, raddr string) {
switch runtime.GOOS {
case "nacl": // see golang.org/issue/9252
t.Skipf("not implemented yet on %s", runtime.GOOS)
case "windows":
if testenv.IsWindowsXP() {
t.Log("skipping broken test on Windows XP (see golang.org/issue/23072)")
return
}
default:
if err != nil {
t.Fatal(err)