|
@@ -1090,11 +1090,13 @@ func doTestJsonLargeInteger(t *testing.T, v interface{}, ias uint8) {
|
|
|
case 'L':
|
|
case 'L':
|
|
|
switch v2 := v.(type) {
|
|
switch v2 := v.(type) {
|
|
|
case int:
|
|
case int:
|
|
|
- if v2 > 1<<53 || (v2 < 0 && -v2 > 1<<53) {
|
|
|
|
|
|
|
+ v2n := int64(v2) // done to work with 32-bit OS
|
|
|
|
|
+ if v2n > 1<<53 || (v2n < 0 && -v2n > 1<<53) {
|
|
|
fnStrChk()
|
|
fnStrChk()
|
|
|
}
|
|
}
|
|
|
case uint:
|
|
case uint:
|
|
|
- if v2 > 1<<53 {
|
|
|
|
|
|
|
+ v2n := uint64(v2) // done to work with 32-bit OS
|
|
|
|
|
+ if v2n > 1<<53 {
|
|
|
fnStrChk()
|
|
fnStrChk()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1412,12 +1414,12 @@ func TestBincUnderlyingType(t *testing.T) {
|
|
|
func TestJsonLargeInteger(t *testing.T) {
|
|
func TestJsonLargeInteger(t *testing.T) {
|
|
|
for _, i := range []uint8{'L', 'A', 0} {
|
|
for _, i := range []uint8{'L', 'A', 0} {
|
|
|
for _, j := range []interface{}{
|
|
for _, j := range []interface{}{
|
|
|
- 1 << 60,
|
|
|
|
|
- -(1 << 60),
|
|
|
|
|
|
|
+ int64(1 << 60),
|
|
|
|
|
+ -int64(1 << 60),
|
|
|
0,
|
|
0,
|
|
|
1 << 20,
|
|
1 << 20,
|
|
|
-(1 << 20),
|
|
-(1 << 20),
|
|
|
- uint(1 << 60),
|
|
|
|
|
|
|
+ uint64(1 << 60),
|
|
|
uint(0),
|
|
uint(0),
|
|
|
uint(1 << 20),
|
|
uint(1 << 20),
|
|
|
} {
|
|
} {
|