diff options
author | Russ Cox <rsc@golang.org> | 2009-01-09 00:17:46 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-01-09 00:17:46 -0800 |
commit | 6506670d5761f96ea24a2692f83765e21576da92 (patch) | |
tree | 8294974762ab403e555ab47cfa23caed71af1549 /src/lib/reflect/all_test.go | |
parent | e09d153f4e7e543dd288ce564b3bba787b01fe7a (diff) | |
download | golang-6506670d5761f96ea24a2692f83765e21576da92.tar.gz |
update sys.reflect and sys.unreflect to accomodate
the possibility of large objects in interface values.
R=r
DELTA=171 (97 added, 22 deleted, 52 changed)
OCL=22382
CL=22382
Diffstat (limited to 'src/lib/reflect/all_test.go')
-rw-r--r-- | src/lib/reflect/all_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/reflect/all_test.go b/src/lib/reflect/all_test.go index eb0bbf9e6..38e2589fe 100644 --- a/src/lib/reflect/all_test.go +++ b/src/lib/reflect/all_test.go @@ -332,3 +332,24 @@ export func TestCopyArray(t *testing.T) { } } } + +export func TestBigUnnamedStruct(t *testing.T) { + b := struct{a,b,c,d int64}{1, 2, 3, 4}; + v := NewValue(b); + b1 := v.Interface().(struct{a,b,c,d int64}); + if b1.a != b.a || b1.b != b.b || b1.c != b.c || b1.d != b.d { + t.Errorf("NewValue(%v).Interface().(Big) = %v", b, b1); + } +} + +type Big struct { + a, b, c, d, e int64 +} +export func TestBigStruct(t *testing.T) { + b := Big{1, 2, 3, 4, 5}; + v := NewValue(b); + b1 := v.Interface().(Big); + if b1.a != b.a || b1.b != b.b || b1.c != b.c || b1.d != b.d || b1.e != b.e { + t.Errorf("NewValue(%v).Interface().(Big) = %v", b, b1); + } +} |