diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-12-22 01:15:33 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-12-22 01:15:33 +0000 |
commit | 409a5e7eb4cca107037fafa4a7eea92603edb83d (patch) | |
tree | 06f36bbef6fae78278f799194ad0df8ba2dabaa1 /libgo/go/math/big/int_test.go | |
parent | 7e9268b4cf01ab87d9b602f592ed2e2facfadda9 (diff) | |
download | gcc-409a5e7eb4cca107037fafa4a7eea92603edb83d.tar.gz |
libgo: Update to revision 15193:6fdc1974457c of master library.
From-SVN: r194692
Diffstat (limited to 'libgo/go/math/big/int_test.go')
-rw-r--r-- | libgo/go/math/big/int_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libgo/go/math/big/int_test.go b/libgo/go/math/big/int_test.go index d3c5a0e8bfe..fd6d152b39d 100644 --- a/libgo/go/math/big/int_test.go +++ b/libgo/go/math/big/int_test.go @@ -1135,6 +1135,36 @@ func TestInt64(t *testing.T) { } } +var uint64Tests = []uint64{ + 0, + 1, + 4294967295, + 4294967296, + 8589934591, + 8589934592, + 9223372036854775807, + 9223372036854775808, + 18446744073709551615, // 1<<64 - 1 +} + +func TestUint64(t *testing.T) { + in := new(Int) + for i, testVal := range uint64Tests { + in.SetUint64(testVal) + out := in.Uint64() + + if out != testVal { + t.Errorf("#%d got %d want %d", i, out, testVal) + } + + str := fmt.Sprint(testVal) + strOut := in.String() + if strOut != str { + t.Errorf("#%d.String got %s want %s", i, strOut, str) + } + } +} + var bitwiseTests = []struct { x, y string and, or, xor, andNot string |