File tree 2 files changed +13
-0
lines changed 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ 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
79
func TestNamedEnum (t * testing.T ) { testNamedEnum (t ) }
80
+ func TestCastToEnum (t * testing.T ) { testCastToEnum (t ) }
80
81
func TestErrno (t * testing.T ) { testErrno (t ) }
81
82
func TestFpVar (t * testing.T ) { testFpVar (t ) }
82
83
func TestHelpers (t * testing.T ) { testHelpers (t ) }
Original file line number Diff line number Diff line change @@ -1013,6 +1013,18 @@ func testNamedEnum(t *testing.T) {
1013
1013
}
1014
1014
}
1015
1015
1016
+ func testCastToEnum (t * testing.T ) {
1017
+ e := C .enum_E (C .Enum1 )
1018
+ if e != 1 {
1019
+ t .Error ("bad enum" , C .Enum1 )
1020
+ }
1021
+
1022
+ e = C .enum_E (C .Enum2 )
1023
+ if e != 2 {
1024
+ t .Error ("bad enum" , C .Enum2 )
1025
+ }
1026
+ }
1027
+
1016
1028
func testAtol (t * testing.T ) {
1017
1029
l := Atol ("123" )
1018
1030
if l != 123 {
You can’t perform that action at this time.
0 commit comments