new = new[1:]
}
if len(new) > 0 {
- t.Errorf("%s: %s has unexpected symbols: %v", new)
+ t.Errorf("%s: %s has unexpected symbols: %v", obj, name, new)
}
}
}
if load.Maxprot != maxprot || load.Prot != prot {
errorf("segment %q protection is %d, %d, want %d, %d",
- load.Maxprot, load.Prot, maxprot, prot)
+ load.Name, load.Maxprot, load.Prot, maxprot, prot)
}
for len(msects) > 0 && msects[0].Addr < load.Addr+load.Memsz {
flags = 1
}
if msect.Flags != flags {
- errorf("section %q flags = %#x, want %#x", msect.Flags, flags)
+ errorf("section %q flags = %#x, want %#x", msect.Name, msect.Flags, flags)
}
sect := &Section{
Name: strings.ToLower(strings.TrimPrefix(msect.Name, "__")),
for j := 0; j < len(pseg.Sections) || j < len(qseg.Sections); j++ {
if j >= len(pseg.Sections) {
- errors = append(errors, fmt.Sprintf("segment %q missing section %q", qseg.Sections[i].Name))
+ errors = append(errors, fmt.Sprintf("segment %q missing section %q", pseg.Name, qseg.Sections[i].Name))
continue
}
if j >= len(qseg.Sections) {
- errors = append(errors, fmt.Sprintf("segment %q has extra section %q", pseg.Sections[i].Name))
+ errors = append(errors, fmt.Sprintf("segment %q has extra section %q", pseg.Name, pseg.Sections[i].Name))
continue
}
psect := pseg.Sections[j]
run("go", "tool", char+"l", "-o", "a.out", "hello.a")
out := run("./a.out")
if out != "hello world\n" {
- t.Fatal("incorrect output: %q, want %q", out, "hello world\n")
+ t.Fatalf("incorrect output: %q, want %q", out, "hello world\n")
}
}
run("go", "tool", char+"l", "-L", ".", "-o", "a.out", "main."+char)
out := run("./a.out")
if out != "ok\n" {
- t.Fatal("incorrect output: %q, want %q", out, "ok\n")
+ t.Fatalf("incorrect output: %q, want %q", out, "ok\n")
}
}
tot: test.realSize,
}
if sfr.numBytes() != nb {
- t.Errorf("test %d: Before reading, sfr.numBytes() = %d, want %d", i, sfr.numBytes, nb)
+ t.Errorf("test %d: Before reading, sfr.numBytes() = %d, want %d", i, sfr.numBytes(), nb)
}
buf, err := ioutil.ReadAll(sfr)
if err != nil {
}
if cert.SignatureAlgorithm != test.sigAlgo {
- t.Errorf("%s: SignatureAlgorithm wasn't copied from template. Got %s, want %s", test.name, cert.SignatureAlgorithm, test.sigAlgo)
+ t.Errorf("%s: SignatureAlgorithm wasn't copied from template. Got %v, want %v", test.name, cert.SignatureAlgorithm, test.sigAlgo)
}
if !reflect.DeepEqual(cert.ExtKeyUsage, testExtKeyUsage) {
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) {
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)
}
}
s, err := StdEncoding.DecodeString("YWJjZA=====")
want := CorruptInputError(8)
if !reflect.DeepEqual(want, err) {
- t.Errorf("Error = %v; want CorruptInputError(8)")
+ t.Errorf("Error = %v; want CorruptInputError(8)", err)
}
if string(s) != "abcd" {
t.Errorf("DecodeString = %q; want abcd", s)
return node.Ident
}
panic("unidentified node type in allIdents")
- return nil
}
// ensurePipelineContains ensures that the pipeline has commands with
ts.Config.ErrorLog = log.New(ioutil.Discard, "", 0)
ts.Config.ConnState = func(c net.Conn, state ConnState) {
if c == nil {
- t.Error("nil conn seen in state %s", state)
+ t.Errorf("nil conn seen in state %s", state)
return
}
mu.Lock()
case <-gotres:
case <-time.After(5 * time.Second):
panic("hang. events are: " + logbuf.String())
- t.Fatal("timeout; cancel didn't work?")
}
got := logbuf.String()
return
}
if !ne.Timeout() {
- t.Error("expected timeout error; got %v", err)
+ t.Errorf("expected timeout error; got %v", err)
}
if !strings.Contains(err.Error(), "handshake timeout") {
- t.Error("expected 'handshake timeout' in error; got %v", err)
+ t.Errorf("expected 'handshake timeout' in error; got %v", err)
}
}()
select {