| 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. |
| 4 |
|
| 5 |
package routebsd |
| 6 |
|
| 7 |
import ( |
| 8 |
"syscall" |
| 9 |
"testing" |
| 10 |
) |
| 11 |
|
| 12 |
func TestFetchRIBMessagesOnDarwin(t *testing.T) { |
| 13 |
for _, typ := range []int{syscall.NET_RT_FLAGS, syscall.NET_RT_DUMP2, syscall.NET_RT_IFLIST2} { |
| 14 |
ms, err := FetchRIBMessages(typ, 0) |
| 15 |
if err != nil { |
| 16 |
t.Error(typ, err) |
| 17 |
continue |
| 18 |
} |
| 19 |
ss, err := msgs(ms).validate() |
| 20 |
if err != nil { |
| 21 |
t.Error(typ, err) |
| 22 |
continue |
| 23 |
} |
| 24 |
for _, s := range ss { |
| 25 |
t.Log(s) |
| 26 |
} |
| 27 |
} |
| 28 |
} |