1
2
3
4
5
6
7 package cgotest
8
9
15 import "C"
16
17 import (
18 "runtime"
19 "testing"
20 )
21
22 func test8694(t *testing.T) {
23 if runtime.GOARCH == "arm" {
24 t.Skip("test8694 is disabled on ARM because 5l cannot handle thumb library.")
25 }
26
27 x := C.complexfloat(2 + 3i)
28 x2 := x * x
29 cx2 := C.complexFloatSquared(x)
30 if cx2 != x2 {
31 t.Errorf("C.complexFloatSquared(%v) = %v, want %v", x, cx2, x2)
32 }
33
34 y := C.complexdouble(2 + 3i)
35 y2 := y * y
36 cy2 := C.complexDoubleSquared(y)
37 if cy2 != y2 {
38 t.Errorf("C.complexDoubleSquared(%v) = %v, want %v", y, cy2, y2)
39 }
40 }
41
View as plain text