]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/binary: improve error messages for benchmarks
authorMarcel van Lohuizen <mpvl@golang.org>
Fri, 18 Mar 2016 13:27:29 +0000 (14:27 +0100)
committerMarcel van Lohuizen <mpvl@golang.org>
Fri, 18 Mar 2016 15:38:58 +0000 (15:38 +0000)
Change-Id: I0f4b6752ecc8b4945ecfde627cdec13fc4bb6a69
Reviewed-on: https://go-review.googlesource.com/20850
Reviewed-by: Russ Cox <rsc@golang.org>
src/encoding/binary/binary_test.go

index 3511a996a1d2b551227b4a572a967ad45d4577eb..fc6ea9534a6115a9284fcd40ce72d5513c9ca628 100644 (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)
        }
 }