bae90c989c
This revision was committed January 7, 2014. The next revision deleted runtime/mfinal.c. That will be done in a subsequent merge. This merge changes type descriptors to add a zero field, pointing to a zero value for that type. This is implemented as a common variable. * go-gcc.cc (Gcc_backend::implicit_variable): Add is_common and alignment parameters. Permit init parameter to be NULL. From-SVN: r211249
47 lines
1.2 KiB
Go
47 lines
1.2 KiB
Go
// Copyright 2013 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build darwin dragonfly freebsd linux netbsd openbsd
|
|
|
|
package net
|
|
|
|
import "testing"
|
|
|
|
func TestDNSReadConfig(t *testing.T) {
|
|
dnsConfig, err := dnsReadConfig("testdata/resolv.conf")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
if len(dnsConfig.servers) != 1 {
|
|
t.Errorf("len(dnsConfig.servers) = %d; want %d", len(dnsConfig.servers), 1)
|
|
}
|
|
if dnsConfig.servers[0] != "[192.168.1.1]" {
|
|
t.Errorf("dnsConfig.servers[0] = %s; want %s", dnsConfig.servers[0], "[192.168.1.1]")
|
|
}
|
|
|
|
if len(dnsConfig.search) != 1 {
|
|
t.Errorf("len(dnsConfig.search) = %d; want %d", len(dnsConfig.search), 1)
|
|
}
|
|
if dnsConfig.search[0] != "Home" {
|
|
t.Errorf("dnsConfig.search[0] = %s; want %s", dnsConfig.search[0], "Home")
|
|
}
|
|
|
|
if dnsConfig.ndots != 5 {
|
|
t.Errorf("dnsConfig.ndots = %d; want %d", dnsConfig.ndots, 5)
|
|
}
|
|
|
|
if dnsConfig.timeout != 10 {
|
|
t.Errorf("dnsConfig.timeout = %d; want %d", dnsConfig.timeout, 10)
|
|
}
|
|
|
|
if dnsConfig.attempts != 3 {
|
|
t.Errorf("dnsConfig.attempts = %d; want %d", dnsConfig.attempts, 3)
|
|
}
|
|
|
|
if dnsConfig.rotate != true {
|
|
t.Errorf("dnsConfig.rotate = %t; want %t", dnsConfig.rotate, true)
|
|
}
|
|
}
|