libgo: update to go1.7rc3

Reviewed-on: https://go-review.googlesource.com/25150

From-SVN: r238662
This commit is contained in:
Ian Lance Taylor 2016-07-22 18:15:38 +00:00
parent 9d04a3af4c
commit 22b955cca5
1155 changed files with 51833 additions and 16672 deletions

View file

@ -7,18 +7,76 @@
package net
import "testing"
import (
"context"
"testing"
)
func TestCgoLookupIP(t *testing.T) {
host := "localhost"
_, err, ok := cgoLookupIP(host)
ctx := context.Background()
_, err, ok := cgoLookupIP(ctx, "localhost")
if !ok {
t.Errorf("cgoLookupIP must not be a placeholder")
}
if err != nil {
t.Error(err)
}
if _, err := goLookupIP(host); err != nil {
}
func TestCgoLookupIPWithCancel(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
_, err, ok := cgoLookupIP(ctx, "localhost")
if !ok {
t.Errorf("cgoLookupIP must not be a placeholder")
}
if err != nil {
t.Error(err)
}
}
func TestCgoLookupPort(t *testing.T) {
ctx := context.Background()
_, err, ok := cgoLookupPort(ctx, "tcp", "smtp")
if !ok {
t.Errorf("cgoLookupPort must not be a placeholder")
}
if err != nil {
t.Error(err)
}
}
func TestCgoLookupPortWithCancel(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
_, err, ok := cgoLookupPort(ctx, "tcp", "smtp")
if !ok {
t.Errorf("cgoLookupPort must not be a placeholder")
}
if err != nil {
t.Error(err)
}
}
func TestCgoLookupPTR(t *testing.T) {
ctx := context.Background()
_, err, ok := cgoLookupPTR(ctx, "127.0.0.1")
if !ok {
t.Errorf("cgoLookupPTR must not be a placeholder")
}
if err != nil {
t.Error(err)
}
}
func TestCgoLookupPTRWithCancel(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
_, err, ok := cgoLookupPTR(ctx, "127.0.0.1")
if !ok {
t.Errorf("cgoLookupPTR must not be a placeholder")
}
if err != nil {
t.Error(err)
}
}