diff options
Diffstat (limited to 'src/pkg/fmt/scan_test.go')
-rw-r--r-- | src/pkg/fmt/scan_test.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pkg/fmt/scan_test.go b/src/pkg/fmt/scan_test.go index b8b3ac975..da13eb2d1 100644 --- a/src/pkg/fmt/scan_test.go +++ b/src/pkg/fmt/scan_test.go @@ -370,7 +370,7 @@ func testScan(name string, t *testing.T, scan func(r io.Reader, a ...interface{} continue } // The incoming value may be a pointer - v := reflect.NewValue(test.in) + v := reflect.ValueOf(test.in) if p := v; p.Kind() == reflect.Ptr { v = p.Elem() } @@ -409,7 +409,7 @@ func TestScanf(t *testing.T) { continue } // The incoming value may be a pointer - v := reflect.NewValue(test.in) + v := reflect.ValueOf(test.in) if p := v; p.Kind() == reflect.Ptr { v = p.Elem() } @@ -486,7 +486,7 @@ func TestInf(t *testing.T) { } func testScanfMulti(name string, t *testing.T) { - sliceType := reflect.Typeof(make([]interface{}, 1)) + sliceType := reflect.TypeOf(make([]interface{}, 1)) for _, test := range multiTests { var r io.Reader if name == "StringReader" { @@ -513,7 +513,7 @@ func testScanfMulti(name string, t *testing.T) { // Convert the slice of pointers into a slice of values resultVal := reflect.MakeSlice(sliceType, n, n) for i := 0; i < n; i++ { - v := reflect.NewValue(test.in[i]).Elem() + v := reflect.ValueOf(test.in[i]).Elem() resultVal.Index(i).Set(v) } result := resultVal.Interface() @@ -810,7 +810,9 @@ func TestScanInts(t *testing.T) { }) } -const intCount = 1000 +// 800 is small enough to not overflow the stack when using gccgo on a +// platform that does not support split stack. +const intCount = 800 func testScanInts(t *testing.T, scan func(*RecursiveInt, *bytes.Buffer) os.Error) { r := new(RecursiveInt) |