-
Notifications
You must be signed in to change notification settings - Fork 1
/
uint64_32b_test.go
45 lines (32 loc) · 1.17 KB
/
uint64_32b_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//go:build 386 || arm
// +build 386 arm
package as_test
import (
"math"
"testing"
"github.com/lunemec/as"
)
func TestUint64(t *testing.T) {
assertError(t, as.Uint64, int8(math.MinInt8))
assertNoError(t, as.Uint64, int8(math.MaxInt8))
pointerToMaxInt8 := int8(math.MaxInt8)
assertNoError(t, as.Int, &pointerToMaxInt8)
assertError(t, as.Uint64, int16(math.MinInt16))
assertNoError(t, as.Uint64, int16(math.MaxInt16))
assertError(t, as.Uint64, int32(math.MinInt32))
assertNoError(t, as.Uint64, int32(math.MaxInt32))
assertError(t, as.Uint64, int64(math.MinInt64))
assertNoError(t, as.Uint64, int64(math.MaxInt64))
assertError(t, as.Uint64, int(math.MinInt32))
assertNoError(t, as.Uint64, int(math.MaxInt32))
assertNoError(t, as.Uint64, uint8(0))
assertNoError(t, as.Uint64, uint8(math.MaxUint8))
assertNoError(t, as.Uint64, uint16(0))
assertNoError(t, as.Uint64, uint16(math.MaxUint16))
assertNoError(t, as.Uint64, uint32(0))
assertNoError(t, as.Uint64, uint32(math.MaxUint32))
assertNoError(t, as.Uint64, uint64(0))
assertNoError(t, as.Uint64, uint64(math.MaxUint64))
assertNoError(t, as.Uint64, uint(0))
assertNoError(t, as.Uint64, uint(math.MaxUint32))
}