File tree 2 files changed +28
-0
lines changed 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ func TestCheckConst(t *testing.T) { testCheckConst(t) }
76
76
func TestConst (t * testing.T ) { testConst (t ) }
77
77
func TestCthread (t * testing.T ) { testCthread (t ) }
78
78
func TestEnum (t * testing.T ) { testEnum (t ) }
79
+ func TestNamedEnum (t * testing.T ) { testNamedEnum (t ) }
80
+ func TestCastToEnum (t * testing.T ) { testCastToEnum (t ) }
79
81
func TestErrno (t * testing.T ) { testErrno (t ) }
80
82
func TestFpVar (t * testing.T ) { testFpVar (t ) }
81
83
func TestHelpers (t * testing.T ) { testHelpers (t ) }
Original file line number Diff line number Diff line change @@ -1000,6 +1000,32 @@ func testEnum(t *testing.T) {
1000
1000
}
1001
1001
}
1002
1002
1003
+ func testNamedEnum (t * testing.T ) {
1004
+ e := new (C.enum_E )
1005
+
1006
+ * e = C .Enum1
1007
+ if * e != 1 {
1008
+ t .Error ("bad enum" , C .Enum1 )
1009
+ }
1010
+
1011
+ * e = C .Enum2
1012
+ if * e != 2 {
1013
+ t .Error ("bad enum" , C .Enum2 )
1014
+ }
1015
+ }
1016
+
1017
+ func testCastToEnum (t * testing.T ) {
1018
+ e := C .enum_E (C .Enum1 )
1019
+ if e != 1 {
1020
+ t .Error ("bad enum" , C .Enum1 )
1021
+ }
1022
+
1023
+ e = C .enum_E (C .Enum2 )
1024
+ if e != 2 {
1025
+ t .Error ("bad enum" , C .Enum2 )
1026
+ }
1027
+ }
1028
+
1003
1029
func testAtol (t * testing.T ) {
1004
1030
l := Atol ("123" )
1005
1031
if l != 123 {
You can’t perform that action at this time.
0 commit comments