Codebase list golang-github-go-openapi-swag / ecfb45a
fixed test on 32-bit arch Signed-off-by: Frederic BIDON <fredbi@yahoo.com> Frederic BIDON 3 years ago
2 changed file(s) with 9 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
99 # include arch ppc, but only for latest go version - skip testing for race
1010 - go: 1.x
1111 arch: ppc64le
12 install: ~
13 script:
14 - go test -v
15
16 - go: 1.x
17 arch: arm
1218 install: ~
1319 script:
1420 - go test -v
7272
7373 func TestConvertInt8(t *testing.T) {
7474 validInts := []int8{0, 1, -1, math.MaxInt8, math.MinInt8}
75 invalidInts := []string{"1.233", "a", "false", strconv.Itoa(int(math.MaxInt64))}
75 invalidInts := []string{"1.233", "a", "false", strconv.FormatInt(int64(math.MaxInt64), 10)}
7676
7777 for _, f := range validInts {
7878 c, err := ConvertInt8(FormatInt8(f))
8888
8989 func TestConvertInt16(t *testing.T) {
9090 validInts := []int16{0, 1, -1, math.MaxInt8, math.MinInt8, math.MaxInt16, math.MinInt16}
91 invalidInts := []string{"1.233", "a", "false", strconv.Itoa(int(math.MaxInt64))}
91 invalidInts := []string{"1.233", "a", "false", strconv.FormatInt(int64(math.MaxInt64), 10)}
9292
9393 for _, f := range validInts {
9494 c, err := ConvertInt16(FormatInt16(f))
104104
105105 func TestConvertInt32(t *testing.T) {
106106 validInts := []int32{0, 1, -1, math.MaxInt8, math.MinInt8, math.MaxInt16, math.MinInt16, math.MinInt32, math.MaxInt32}
107 invalidInts := []string{"1.233", "a", "false", strconv.Itoa(int(math.MaxInt64))}
107 invalidInts := []string{"1.233", "a", "false", strconv.FormatInt(int64(math.MaxInt64), 10)}
108108
109109 for _, f := range validInts {
110110 c, err := ConvertInt32(FormatInt32(f))