1
0
mirror of https://github.com/golang/go synced 2024-09-25 07:20:12 -06:00

encoding/binary: improve error messages for benchmarks

Change-Id: I0f4b6752ecc8b4945ecfde627cdec13fc4bb6a69
Reviewed-on: https://go-review.googlesource.com/20850
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Marcel van Lohuizen 2016-03-18 14:27:29 +01:00
parent b2dc1f82a5
commit 705be76b6f

View File

@ -374,7 +374,7 @@ func BenchmarkReadStruct(b *testing.B) {
}
b.StopTimer()
if !reflect.DeepEqual(s, t) {
b.Fatal("no match")
b.Fatalf("struct doesn't match:\ngot %v;\nwant %v", t, s)
}
}
@ -406,7 +406,7 @@ func BenchmarkReadInts(b *testing.B) {
}
b.StopTimer()
if !reflect.DeepEqual(ls, want) {
panic("no match")
b.Fatalf("struct doesn't match:\ngot %v;\nwant %v", ls, want)
}
}