libgo: update to go1.7rc3
Reviewed-on: https://go-review.googlesource.com/25150 From-SVN: r238662
This commit is contained in:
parent
9d04a3af4c
commit
22b955cca5
1155 changed files with 51833 additions and 16672 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue