diff options
Diffstat (limited to 'tests/expectations/class_with_inner_struct.rs')
-rw-r--r-- | tests/expectations/class_with_inner_struct.rs | 205 |
1 files changed, 86 insertions, 119 deletions
diff --git a/tests/expectations/class_with_inner_struct.rs b/tests/expectations/class_with_inner_struct.rs index b465a183..464c622d 100644 --- a/tests/expectations/class_with_inner_struct.rs +++ b/tests/expectations/class_with_inner_struct.rs @@ -4,7 +4,7 @@ #![allow(non_snake_case)] -#[derive(Copy, Debug)] +#[derive(Debug)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); impl <T> __BindgenUnionField<T> { @@ -23,109 +23,94 @@ impl <T> ::std::clone::Clone for __BindgenUnionField<T> { #[inline] fn clone(&self) -> Self { Self::new() } } +impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_A { +pub struct A { pub c: ::std::os::raw::c_uint, - pub named_union: Union_A_class_with_inner_struct_hpp_unnamed_1, - pub A_class_with_inner_struct_hpp_unnamed_2: Union_A_class_with_inner_struct_hpp_unnamed_2, + pub named_union: A__bindgen_ty_bindgen_id_6, + pub __bindgen_anon_1: A__bindgen_ty_bindgen_id_9, } #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_A_Segment { +pub struct A_Segment { pub begin: ::std::os::raw::c_int, pub end: ::std::os::raw::c_int, } -impl ::std::clone::Clone for Struct_A_Segment { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_Struct_A_Segment() { - assert_eq!(::std::mem::size_of::<Struct_A_Segment>() , 8usize); - assert_eq!(::std::mem::align_of::<Struct_A_Segment>() , 4usize); +fn bindgen_test_layout_A_Segment() { + assert_eq!(::std::mem::size_of::<A_Segment>() , 8usize); + assert_eq!(::std::mem::align_of::<A_Segment>() , 4usize); +} +impl Clone for A_Segment { + fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Debug, Copy)] -pub struct Union_A_class_with_inner_struct_hpp_unnamed_1 { +pub struct A__bindgen_ty_bindgen_id_6 { pub f: __BindgenUnionField<::std::os::raw::c_int>, - pub _bindgen_data_: u32, + pub bindgen_union_field: u32, } -impl Union_A_class_with_inner_struct_hpp_unnamed_1 { - pub unsafe fn f(&mut self) -> *mut ::std::os::raw::c_int { - let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); - ::std::mem::transmute(raw.offset(0)) - } +#[test] +fn bindgen_test_layout_A__bindgen_ty_bindgen_id_6() { + assert_eq!(::std::mem::size_of::<A__bindgen_ty_bindgen_id_6>() , 4usize); + assert_eq!(::std::mem::align_of::<A__bindgen_ty_bindgen_id_6>() , 4usize); } -impl ::std::clone::Clone for Union_A_class_with_inner_struct_hpp_unnamed_1 { +impl Clone for A__bindgen_ty_bindgen_id_6 { fn clone(&self) -> Self { *self } } -#[test] -fn bindgen_test_layout_Union_A_class_with_inner_struct_hpp_unnamed_1() { - assert_eq!(::std::mem::size_of::<Union_A_class_with_inner_struct_hpp_unnamed_1>() - , 4usize); - assert_eq!(::std::mem::align_of::<Union_A_class_with_inner_struct_hpp_unnamed_1>() - , 4usize); -} #[repr(C)] #[derive(Debug, Copy)] -pub struct Union_A_class_with_inner_struct_hpp_unnamed_2 { +pub struct A__bindgen_ty_bindgen_id_9 { pub d: __BindgenUnionField<::std::os::raw::c_int>, - pub _bindgen_data_: u32, + pub bindgen_union_field: u32, } -impl Union_A_class_with_inner_struct_hpp_unnamed_2 { - pub unsafe fn d(&mut self) -> *mut ::std::os::raw::c_int { - let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); - ::std::mem::transmute(raw.offset(0)) - } +#[test] +fn bindgen_test_layout_A__bindgen_ty_bindgen_id_9() { + assert_eq!(::std::mem::size_of::<A__bindgen_ty_bindgen_id_9>() , 4usize); + assert_eq!(::std::mem::align_of::<A__bindgen_ty_bindgen_id_9>() , 4usize); } -impl ::std::clone::Clone for Union_A_class_with_inner_struct_hpp_unnamed_2 { +impl Clone for A__bindgen_ty_bindgen_id_9 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_Union_A_class_with_inner_struct_hpp_unnamed_2() { - assert_eq!(::std::mem::size_of::<Union_A_class_with_inner_struct_hpp_unnamed_2>() - , 4usize); - assert_eq!(::std::mem::align_of::<Union_A_class_with_inner_struct_hpp_unnamed_2>() - , 4usize); +fn bindgen_test_layout_A() { + assert_eq!(::std::mem::size_of::<A>() , 12usize); + assert_eq!(::std::mem::align_of::<A>() , 4usize); } -impl ::std::clone::Clone for Struct_A { +impl Clone for A { fn clone(&self) -> Self { *self } } -#[test] -fn bindgen_test_layout_Struct_A() { - assert_eq!(::std::mem::size_of::<Struct_A>() , 12usize); - assert_eq!(::std::mem::align_of::<Struct_A>() , 4usize); -} #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_B { +pub struct B { pub d: ::std::os::raw::c_uint, } #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_B_Segment { +pub struct B_Segment { pub begin: ::std::os::raw::c_int, pub end: ::std::os::raw::c_int, } -impl ::std::clone::Clone for Struct_B_Segment { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_Struct_B_Segment() { - assert_eq!(::std::mem::size_of::<Struct_B_Segment>() , 8usize); - assert_eq!(::std::mem::align_of::<Struct_B_Segment>() , 4usize); +fn bindgen_test_layout_B_Segment() { + assert_eq!(::std::mem::size_of::<B_Segment>() , 8usize); + assert_eq!(::std::mem::align_of::<B_Segment>() , 4usize); } -impl ::std::clone::Clone for Struct_B { +impl Clone for B_Segment { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_Struct_B() { - assert_eq!(::std::mem::size_of::<Struct_B>() , 4usize); - assert_eq!(::std::mem::align_of::<Struct_B>() , 4usize); +fn bindgen_test_layout_B() { + assert_eq!(::std::mem::size_of::<B>() , 4usize); + assert_eq!(::std::mem::align_of::<B>() , 4usize); +} +impl Clone for B { + fn clone(&self) -> Self { *self } } #[repr(i32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] -pub enum Enum_StepSyntax { +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum StepSyntax { Keyword = 0, FunctionalWithoutKeyword = 1, FunctionalWithStartKeyword = 2, @@ -133,98 +118,80 @@ pub enum Enum_StepSyntax { } #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_C { +pub struct C { pub d: ::std::os::raw::c_uint, - pub C_class_with_inner_struct_hpp_unnamed_3: Union_C_class_with_inner_struct_hpp_unnamed_3, + pub __bindgen_anon_1: C__bindgen_ty_bindgen_id_21, } #[repr(C)] #[derive(Debug, Copy)] -pub struct Union_C_class_with_inner_struct_hpp_unnamed_3 { - pub mFunc: __BindgenUnionField<Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_4>, - pub C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_5: __BindgenUnionField<Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_5>, - pub _bindgen_data_: [u32; 4usize], -} -impl Union_C_class_with_inner_struct_hpp_unnamed_3 { - pub unsafe fn mFunc(&mut self) - -> - *mut Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_4 { - let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); - ::std::mem::transmute(raw.offset(0)) - } - pub unsafe fn C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_5(&mut self) - -> - *mut Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_5 { - let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); - ::std::mem::transmute(raw.offset(0)) - } -} -impl ::std::clone::Clone for Union_C_class_with_inner_struct_hpp_unnamed_3 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_Union_C_class_with_inner_struct_hpp_unnamed_3() { - assert_eq!(::std::mem::size_of::<Union_C_class_with_inner_struct_hpp_unnamed_3>() - , 16usize); - assert_eq!(::std::mem::align_of::<Union_C_class_with_inner_struct_hpp_unnamed_3>() - , 4usize); +pub struct C__bindgen_ty_bindgen_id_21 { + pub mFunc: __BindgenUnionField<C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_22>, + pub __bindgen_anon_1: __BindgenUnionField<C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_28>, + pub bindgen_union_field: [u32; 4usize], } #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_4 { +pub struct C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_22 { pub mX1: f32, pub mY1: f32, pub mX2: f32, pub mY2: f32, } -impl ::std::clone::Clone for - Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_4 - { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_4() { - assert_eq!(::std::mem::size_of::<Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_4>() +fn bindgen_test_layout_C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_22() { + assert_eq!(::std::mem::size_of::<C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_22>() , 16usize); - assert_eq!(::std::mem::align_of::<Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_4>() + assert_eq!(::std::mem::align_of::<C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_22>() , 4usize); } +impl Clone for C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_22 { + fn clone(&self) -> Self { *self } +} #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_5 { - pub mStepSyntax: Enum_StepSyntax, +pub struct C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_28 { + pub mStepSyntax: StepSyntax, pub mSteps: ::std::os::raw::c_uint, } -impl ::std::clone::Clone for - Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_5 - { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_5() { - assert_eq!(::std::mem::size_of::<Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_5>() +fn bindgen_test_layout_C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_28() { + assert_eq!(::std::mem::size_of::<C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_28>() , 8usize); - assert_eq!(::std::mem::align_of::<Struct_C_class_with_inner_struct_hpp_unnamed_3_class_with_inner_struct_hpp_unnamed_5>() + assert_eq!(::std::mem::align_of::<C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_28>() , 4usize); } +impl Clone for C__bindgen_ty_bindgen_id_21__bindgen_ty_bindgen_id_28 { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_C__bindgen_ty_bindgen_id_21() { + assert_eq!(::std::mem::size_of::<C__bindgen_ty_bindgen_id_21>() , + 16usize); + assert_eq!(::std::mem::align_of::<C__bindgen_ty_bindgen_id_21>() , + 4usize); +} +impl Clone for C__bindgen_ty_bindgen_id_21 { + fn clone(&self) -> Self { *self } +} #[repr(C)] #[derive(Debug, Copy)] -pub struct Struct_C_Segment { +pub struct C_Segment { pub begin: ::std::os::raw::c_int, pub end: ::std::os::raw::c_int, } -impl ::std::clone::Clone for Struct_C_Segment { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_Struct_C_Segment() { - assert_eq!(::std::mem::size_of::<Struct_C_Segment>() , 8usize); - assert_eq!(::std::mem::align_of::<Struct_C_Segment>() , 4usize); +fn bindgen_test_layout_C_Segment() { + assert_eq!(::std::mem::size_of::<C_Segment>() , 8usize); + assert_eq!(::std::mem::align_of::<C_Segment>() , 4usize); } -impl ::std::clone::Clone for Struct_C { +impl Clone for C_Segment { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_Struct_C() { - assert_eq!(::std::mem::size_of::<Struct_C>() , 20usize); - assert_eq!(::std::mem::align_of::<Struct_C>() , 4usize); +fn bindgen_test_layout_C() { + assert_eq!(::std::mem::size_of::<C>() , 20usize); + assert_eq!(::std::mem::align_of::<C>() , 4usize); +} +impl Clone for C { + fn clone(&self) -> Self { *self } } |