Commit 742f755a authored by Keith Randall's avatar Keith Randall

reflect: test to make sure big Zero()-obtained objects are really zero.

Update #6876.

R=dave, bradfitz
CC=golang-dev
https://golang.org/cl/36370043
parent e7d899cb
......@@ -3640,3 +3640,14 @@ func TestReflectMethodTraceback(t *testing.T) {
t.Errorf("Call returned %d; want 8", i)
}
}
func TestBigZero(t *testing.T) {
const size = 1 << 10
var v [size]byte
z := Zero(ValueOf(v).Type()).Interface().([size]byte)
for i := 0; i < size; i++ {
if z[i] != 0 {
t.Fatalf("Zero object not all zero, index %d", i)
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment