aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/encoding
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2013-02-10 06:02:38 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2013-02-10 06:02:38 +0000
commitd54fc074734ea7467a0861c861b145c8ef740bf4 (patch)
treefe1dad02b57206be8eeb4f61819b2f677ea99ee4 /libgo/go/encoding
parent8e29a61c2dc3d591cba39c4f4e8933a76493b22f (diff)
downloadgcc-d54fc074734ea7467a0861c861b145c8ef740bf4.zip
gcc-d54fc074734ea7467a0861c861b145c8ef740bf4.tar.gz
gcc-d54fc074734ea7467a0861c861b145c8ef740bf4.tar.bz2
compiler, libgo: Permit testing package when test imports it circularly.
From-SVN: r195931
Diffstat (limited to 'libgo/go/encoding')
-rw-r--r--libgo/go/encoding/binary/binary_test.go5
-rw-r--r--libgo/go/encoding/binary/export_test.go15
-rw-r--r--libgo/go/encoding/binary/varint_test.go7
3 files changed, 5 insertions, 22 deletions
diff --git a/libgo/go/encoding/binary/binary_test.go b/libgo/go/encoding/binary/binary_test.go
index 7fe3f88..cfad8d3 100644
--- a/libgo/go/encoding/binary/binary_test.go
+++ b/libgo/go/encoding/binary/binary_test.go
@@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package binary_test
+package binary
import (
"bytes"
- . "encoding/binary"
"io"
"math"
"reflect"
@@ -239,7 +238,7 @@ func BenchmarkReadStruct(b *testing.B) {
bsr := &byteSliceReader{}
var buf bytes.Buffer
Write(&buf, BigEndian, &s)
- n := DataSize(reflect.ValueOf(s))
+ n := dataSize(reflect.ValueOf(s))
b.SetBytes(int64(n))
t := s
b.ResetTimer()
diff --git a/libgo/go/encoding/binary/export_test.go b/libgo/go/encoding/binary/export_test.go
deleted file mode 100644
index 9eae2a9..0000000
--- a/libgo/go/encoding/binary/export_test.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package binary
-
-import "reflect"
-
-// Export for testing.
-
-func DataSize(v reflect.Value) int {
- return dataSize(v)
-}
-
-var Overflow = overflow
diff --git a/libgo/go/encoding/binary/varint_test.go b/libgo/go/encoding/binary/varint_test.go
index f67ca63..9476bd5 100644
--- a/libgo/go/encoding/binary/varint_test.go
+++ b/libgo/go/encoding/binary/varint_test.go
@@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package binary_test
+package binary
import (
"bytes"
- . "encoding/binary"
"io"
"testing"
)
@@ -135,8 +134,8 @@ func testOverflow(t *testing.T, buf []byte, n0 int, err0 error) {
}
func TestOverflow(t *testing.T) {
- testOverflow(t, []byte{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x2}, -10, Overflow)
- testOverflow(t, []byte{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x1, 0, 0}, -13, Overflow)
+ testOverflow(t, []byte{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x2}, -10, overflow)
+ testOverflow(t, []byte{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x1, 0, 0}, -13, overflow)
}
func TestNonCanonicalZero(t *testing.T) {