cgo_unix_test.go 578 B

12345678910111213141516171819202122232425
  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. // +build cgo,!netgo
  5. // +build darwin dragonfly freebsd linux netbsd openbsd
  6. package net
  7. import "testing"
  8. func TestCgoLookupIP(t *testing.T) {
  9. host := "localhost"
  10. _, err, ok := cgoLookupIP(host)
  11. if !ok {
  12. t.Errorf("cgoLookupIP must not be a placeholder")
  13. }
  14. if err != nil {
  15. t.Errorf("cgoLookupIP failed: %v", err)
  16. }
  17. if _, err := goLookupIP(host); err != nil {
  18. t.Errorf("goLookupIP failed: %v", err)
  19. }
  20. }