blob: 4d5ab23fd3647fa375102e91d7664b8903fc4b08 [file] [log] [blame]
Mikio Hara2b3ad822013-12-19 07:40:10 +09001// Copyright 2013 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build cgo,!netgo
Mikio Hara82359d12015-05-09 01:29:03 +09006// +build darwin dragonfly freebsd linux netbsd openbsd solaris
Mikio Hara2b3ad822013-12-19 07:40:10 +09007
8package net
9
10import "testing"
11
12func TestCgoLookupIP(t *testing.T) {
13 host := "localhost"
14 _, err, ok := cgoLookupIP(host)
15 if !ok {
16 t.Errorf("cgoLookupIP must not be a placeholder")
17 }
18 if err != nil {
Mikio Haraf77e10f2015-05-01 12:38:42 +090019 t.Error(err)
Mikio Hara2b3ad822013-12-19 07:40:10 +090020 }
21 if _, err := goLookupIP(host); err != nil {
Mikio Haraf77e10f2015-05-01 12:38:42 +090022 t.Error(err)
Mikio Hara2b3ad822013-12-19 07:40:10 +090023 }
24}