t.Fatal("unpacking failed")
}
if n != len(buf) {
- t.Error("unpacked different amount than packed: got n = %d, want = %d", n, len(buf))
+ t.Errorf("unpacked different amount than packed: got n = %d, want = %d", n, len(buf))
}
if !reflect.DeepEqual(got, want) {
t.Errorf("got = %+v, want = %+v", got, want)
continue
}
if n != len(buf) {
- t.Error(
+ t.Errorf(
"unpacked different amount than packed for %s: got n = %d, want = %d",
test.in,
n,
if bytes.Contains(line, []byte("Connection Name:")) {
f := bytes.Split(line, []byte{':'})
if len(f) != 2 {
- t.Fatal("unexpected \"Connection Name\" line: %q", line)
+ t.Fatalf("unexpected \"Connection Name\" line: %q", line)
}
name = string(bytes.TrimSpace(f[1]))
if name == "" {
- t.Fatal("empty name on \"Connection Name\" line: %q", line)
+ t.Fatalf("empty name on \"Connection Name\" line: %q", line)
}
}
if bytes.Contains(line, []byte("Physical Address:")) {
if name == "" {
- t.Fatal("no matching name found: %q", string(out))
+ t.Fatalf("no matching name found: %q", string(out))
}
f := bytes.Split(line, []byte{':'})
if len(f) != 2 {
- t.Fatal("unexpected \"Physical Address\" line: %q", line)
+ t.Fatalf("unexpected \"Physical Address\" line: %q", line)
}
addr := string(bytes.ToLower(bytes.TrimSpace(f[1])))
if addr == "" {
- t.Fatal("empty address on \"Physical Address\" line: %q", line)
+ t.Fatalf("empty address on \"Physical Address\" line: %q", line)
}
if addr == "disabled" || addr == "n/a" {
continue