Mikio Hara | 2b3ad82 | 2013-12-19 07:40:10 +0900 | [diff] [blame] | 1 | // 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 Hara | 82359d1 | 2015-05-09 01:29:03 +0900 | [diff] [blame] | 6 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris |
Mikio Hara | 2b3ad82 | 2013-12-19 07:40:10 +0900 | [diff] [blame] | 7 | |
| 8 | package net |
| 9 | |
| 10 | import "testing" |
| 11 | |
| 12 | func 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 Hara | f77e10f | 2015-05-01 12:38:42 +0900 | [diff] [blame] | 19 | t.Error(err) |
Mikio Hara | 2b3ad82 | 2013-12-19 07:40:10 +0900 | [diff] [blame] | 20 | } |
| 21 | if _, err := goLookupIP(host); err != nil { |
Mikio Hara | f77e10f | 2015-05-01 12:38:42 +0900 | [diff] [blame] | 22 | t.Error(err) |
Mikio Hara | 2b3ad82 | 2013-12-19 07:40:10 +0900 | [diff] [blame] | 23 | } |
| 24 | } |