Skip to content

Commit 48808ed

Browse files
committed
tests: Add a test for bool enum with an alias.
1 parent ff36981 commit 48808ed

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

tests/expectations/tests/enum_explicit_type.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ pub enum MuchULongLong {
4343
pub enum BoolEnumsAreFun {
4444
Value = 1,
4545
}
46+
pub type MyType = bool;
47+
#[repr(u8)]
48+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
49+
pub enum BoolEnumsAreFun2 {
50+
Value2 = 1,
51+
}
4652
pub const AnonymousVariantOne: _bindgen_ty_1 =
4753
_bindgen_ty_1::AnonymousVariantOne;
4854
pub const AnonymousVariantTwo: _bindgen_ty_1 =

tests/expectations/tests/enum_explicit_type_constants.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ pub const MuchULongLong_MuchHigh: MuchULongLong = 4294967296;
2222
pub type MuchULongLong = ::std::os::raw::c_ulonglong;
2323
pub const BoolEnumsAreFun_Value: BoolEnumsAreFun = true;
2424
pub type BoolEnumsAreFun = bool;
25+
pub type MyType = bool;
26+
pub const BoolEnumsAreFun2_Value2: BoolEnumsAreFun2 = true;
27+
pub type BoolEnumsAreFun2 = MyType;
2528
pub const AnonymousVariantOne: ::std::os::raw::c_uchar = 0;
2629
pub const AnonymousVariantTwo: ::std::os::raw::c_uchar = 1;

tests/headers/enum_explicit_type.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ enum BoolEnumsAreFun: bool {
3131
Value = true,
3232
};
3333

34+
using MyType = bool;
35+
enum BoolEnumsAreFun2: MyType {
36+
Value2 = true,
37+
};
38+
3439
enum : unsigned char {
3540
AnonymousVariantOne,
3641
AnonymousVariantTwo,

0 commit comments

Comments
 (0)