libgo: update to go1.9
[official-gcc.git] / libgo / go / golang_org / x / net / route / message_darwin_test.go
blob316aa75071d1e2bb5741e54505a23c09796f40ca
1 // Copyright 2016 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.
5 package route
7 import "testing"
9 func TestFetchAndParseRIBOnDarwin(t *testing.T) {
10 for _, typ := range []RIBType{sysNET_RT_FLAGS, sysNET_RT_DUMP2, sysNET_RT_IFLIST2} {
11 var lastErr error
12 var ms []Message
13 for _, af := range []int{sysAF_UNSPEC, sysAF_INET, sysAF_INET6} {
14 rs, err := fetchAndParseRIB(af, typ)
15 if err != nil {
16 lastErr = err
17 continue
19 ms = append(ms, rs...)
21 if len(ms) == 0 && lastErr != nil {
22 t.Error(typ, lastErr)
23 continue
25 ss, err := msgs(ms).validate()
26 if err != nil {
27 t.Error(typ, err)
28 continue
30 for _, s := range ss {
31 t.Log(s)