func TestSize(t *testing.T) {
var p XPos
if unsafe.Alignof(p) != 4 {
- t.Errorf("alignment = %s; want 4", unsafe.Alignof(p))
+ t.Errorf("alignment = %v; want 4", unsafe.Alignof(p))
}
if unsafe.Sizeof(p) != 8 {
- t.Errorf("size = %s; want 8", unsafe.Sizeof(p))
+ t.Errorf("size = %v; want 8", unsafe.Sizeof(p))
}
}
tmpDir, err := ioutil.TempDir("", "TestNM")
if err != nil {
- fmt.Printf("TempDir failed: ", err)
+ fmt.Println("TempDir failed:", err)
return 2
}
defer os.RemoveAll(tmpDir)
testnmpath = filepath.Join(tmpDir, "testnm.exe")
gotool, err := testenv.GoTool()
if err != nil {
- fmt.Printf("GoTool failed: ", err)
+ fmt.Println("GoTool failed:", err)
return 2
}
out, err := exec.Command(gotool, "build", "-o", testnmpath, "cmd/nm").CombinedOutput()
}
err = scanner.Err()
if err != nil {
- t.Fatal("error reading nm output: %v", err)
+ t.Fatalf("error reading nm output: %v", err)
}
if len(names) > 0 {
t.Errorf("executable is missing %v symbols", names)
n[0] = Word(i)
pseudo := cond(n)
if pseudo && (len(want) == 0 || i != want[0]) {
- t.Errorf("%s(%v, base=2) = %v, want false", name, i)
+ t.Errorf("%s(%v, base=2) = true, want false", name, i)
} else if !pseudo && len(want) >= 1 && i == want[0] {
t.Errorf("%s(%v, base=2) = false, want true", name, i)
}