Skip to content

Commit

Permalink
Merge pull request #1680 from UweErikMartin/fix_iface_windows_test.go
Browse files Browse the repository at this point in the history
pkg/ip/iface_windows_test.go: fix TestGetInterfaceByIP
  • Loading branch information
rbrtbnfgl authored Nov 30, 2022
2 parents 74e906e + c90da1b commit bf5f560
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/ip/iface_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ func TestGetInterfaceByIP(t *testing.T) {
t.Fatal(err)
}

iface, err := GetInterfaceByIP(defaultIpv4Addr)
if err != nil {
t.Fatal(err)
}
for _, addr := range defaultIpv4Addr {
iface, err := GetInterfaceByIP(addr)
if err != nil {
t.Fatal(err)
}

if iface.Index != defaultIface.Index {
t.Fatalf("iface.Index(%d) != defaultIface.Index(%d)", iface.Index, defaultIface.Index)
if iface.Index != defaultIface.Index {
t.Fatalf("iface.Index(%d) != defaultIface.Index(%d)", iface.Index, defaultIface.Index)
}
}
}

Expand Down

0 comments on commit bf5f560

Please sign in to comment.