macho: fix tests
Fix a few bugs that are causing the tests to fail.
Change-Id: Ie2d1b76ee4650a17092a0ff8aef004d118dabe84
Reviewed-on: https://go-review.googlesource.com/92419
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/macho/file_test.go b/macho/file_test.go
index 0de9184..4797780 100644
--- a/macho/file_test.go
+++ b/macho/file_test.go
@@ -184,7 +184,7 @@
ftArch := &fileTests[i]
if arch.Cpu != ftArch.hdr.Cpu || arch.SubCpu != ftArch.hdr.SubCpu {
- t.Error("OpenFat: architecture #%d got cpu=%#x subtype=%#x, expected cpu=%#x, subtype=%#x", i, arch.Cpu, arch.SubCpu, ftArch.hdr.Cpu, ftArch.hdr.SubCpu)
+ t.Errorf("OpenFat: architecture #%d got cpu=%#x subtype=%#x, expected cpu=%#x, subtype=%#x", i, arch.Cpu, arch.SubCpu, ftArch.hdr.Cpu, ftArch.hdr.SubCpu)
}
if !reflect.DeepEqual(arch.FileHeader, ftArch.hdr) {
@@ -202,9 +202,9 @@
filename = "testdata/gcc-386-darwin-exec" // not a fat Mach-O
ff, err := OpenFat(filename)
if err != ErrNotFat {
- t.Errorf("OpenFat %s: got %v, want ErrNotFat", err)
+ t.Errorf("OpenFat %s: got %v, want ErrNotFat", filename, err)
}
if ff != nil {
- t.Errorf("OpenFat %s: got %v, want nil", ff)
+ t.Errorf("OpenFat %s: got %v, want nil", filename, ff)
}
}