diff options
Diffstat (limited to 'libbindgen/tests')
344 files changed, 0 insertions, 8762 deletions
diff --git a/libbindgen/tests/expectations/Cargo.toml b/libbindgen/tests/expectations/Cargo.toml deleted file mode 100644 index 0980c564..00000000 --- a/libbindgen/tests/expectations/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "tests_expectations" -description = "bindgen results when ran on ../headers/*" -version = "0.1.0" -authors = [ - "Jyun-Yan You <jyyou.tw@gmail.com>", - "Emilio Cobos Álvarez <ecoal95@gmail.com>", - "The Servo project developers", -] -workspace = "../../.." - -[dependencies] diff --git a/libbindgen/tests/expectations/src/lib.rs b/libbindgen/tests/expectations/src/lib.rs deleted file mode 100644 index e69de29b..00000000 --- a/libbindgen/tests/expectations/src/lib.rs +++ /dev/null diff --git a/libbindgen/tests/expectations/tests/accessors.rs b/libbindgen/tests/expectations/tests/accessors.rs deleted file mode 100644 index b721980c..00000000 --- a/libbindgen/tests/expectations/tests/accessors.rs +++ /dev/null @@ -1,204 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct SomeAccessors { - pub mNoAccessor: ::std::os::raw::c_int, - /** <div rustbindgen accessor></div> */ - pub mBothAccessors: ::std::os::raw::c_int, - /** <div rustbindgen accessor="unsafe"></div> */ - pub mUnsafeAccessors: ::std::os::raw::c_int, - /** <div rustbindgen accessor="immutable"></div> */ - pub mImmutableAccessor: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_SomeAccessors() { - assert_eq!(::std::mem::size_of::<SomeAccessors>() , 16usize); - assert_eq!(::std::mem::align_of::<SomeAccessors>() , 4usize); -} -impl Clone for SomeAccessors { - fn clone(&self) -> Self { *self } -} -impl SomeAccessors { - #[inline] - pub fn get_mBothAccessors(&self) -> &::std::os::raw::c_int { - &self.mBothAccessors - } - #[inline] - pub fn get_mBothAccessors_mut(&mut self) -> &mut ::std::os::raw::c_int { - &mut self.mBothAccessors - } - #[inline] - pub unsafe fn get_mUnsafeAccessors(&self) -> &::std::os::raw::c_int { - &self.mUnsafeAccessors - } - #[inline] - pub unsafe fn get_mUnsafeAccessors_mut(&mut self) - -> &mut ::std::os::raw::c_int { - &mut self.mUnsafeAccessors - } - #[inline] - pub fn get_mImmutableAccessor(&self) -> &::std::os::raw::c_int { - &self.mImmutableAccessor - } -} -/** <div rustbindgen accessor></div> */ -#[repr(C)] -#[derive(Debug, Copy)] -pub struct AllAccessors { - pub mBothAccessors: ::std::os::raw::c_int, - pub mAlsoBothAccessors: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_AllAccessors() { - assert_eq!(::std::mem::size_of::<AllAccessors>() , 8usize); - assert_eq!(::std::mem::align_of::<AllAccessors>() , 4usize); -} -impl Clone for AllAccessors { - fn clone(&self) -> Self { *self } -} -impl AllAccessors { - #[inline] - pub fn get_mBothAccessors(&self) -> &::std::os::raw::c_int { - &self.mBothAccessors - } - #[inline] - pub fn get_mBothAccessors_mut(&mut self) -> &mut ::std::os::raw::c_int { - &mut self.mBothAccessors - } - #[inline] - pub fn get_mAlsoBothAccessors(&self) -> &::std::os::raw::c_int { - &self.mAlsoBothAccessors - } - #[inline] - pub fn get_mAlsoBothAccessors_mut(&mut self) - -> &mut ::std::os::raw::c_int { - &mut self.mAlsoBothAccessors - } -} -/** <div rustbindgen accessor="unsafe"></div> */ -#[repr(C)] -#[derive(Debug, Copy)] -pub struct AllUnsafeAccessors { - pub mBothAccessors: ::std::os::raw::c_int, - pub mAlsoBothAccessors: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_AllUnsafeAccessors() { - assert_eq!(::std::mem::size_of::<AllUnsafeAccessors>() , 8usize); - assert_eq!(::std::mem::align_of::<AllUnsafeAccessors>() , 4usize); -} -impl Clone for AllUnsafeAccessors { - fn clone(&self) -> Self { *self } -} -impl AllUnsafeAccessors { - #[inline] - pub unsafe fn get_mBothAccessors(&self) -> &::std::os::raw::c_int { - &self.mBothAccessors - } - #[inline] - pub unsafe fn get_mBothAccessors_mut(&mut self) - -> &mut ::std::os::raw::c_int { - &mut self.mBothAccessors - } - #[inline] - pub unsafe fn get_mAlsoBothAccessors(&self) -> &::std::os::raw::c_int { - &self.mAlsoBothAccessors - } - #[inline] - pub unsafe fn get_mAlsoBothAccessors_mut(&mut self) - -> &mut ::std::os::raw::c_int { - &mut self.mAlsoBothAccessors - } -} -/** <div rustbindgen accessor></div> */ -#[repr(C)] -#[derive(Debug, Copy)] -pub struct ContradictAccessors { - pub mBothAccessors: ::std::os::raw::c_int, - /** <div rustbindgen accessor="false"></div> */ - pub mNoAccessors: ::std::os::raw::c_int, - /** <div rustbindgen accessor="unsafe"></div> */ - pub mUnsafeAccessors: ::std::os::raw::c_int, - /** <div rustbindgen accessor="immutable"></div> */ - pub mImmutableAccessor: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_ContradictAccessors() { - assert_eq!(::std::mem::size_of::<ContradictAccessors>() , 16usize); - assert_eq!(::std::mem::align_of::<ContradictAccessors>() , 4usize); -} -impl Clone for ContradictAccessors { - fn clone(&self) -> Self { *self } -} -impl ContradictAccessors { - #[inline] - pub fn get_mBothAccessors(&self) -> &::std::os::raw::c_int { - &self.mBothAccessors - } - #[inline] - pub fn get_mBothAccessors_mut(&mut self) -> &mut ::std::os::raw::c_int { - &mut self.mBothAccessors - } - #[inline] - pub unsafe fn get_mUnsafeAccessors(&self) -> &::std::os::raw::c_int { - &self.mUnsafeAccessors - } - #[inline] - pub unsafe fn get_mUnsafeAccessors_mut(&mut self) - -> &mut ::std::os::raw::c_int { - &mut self.mUnsafeAccessors - } - #[inline] - pub fn get_mImmutableAccessor(&self) -> &::std::os::raw::c_int { - &self.mImmutableAccessor - } -} -/** <div rustbindgen accessor replaces="Replaced"></div> */ -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Replaced { - pub mAccessor: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Replaced() { - assert_eq!(::std::mem::size_of::<Replaced>() , 4usize); - assert_eq!(::std::mem::align_of::<Replaced>() , 4usize); -} -impl Clone for Replaced { - fn clone(&self) -> Self { *self } -} -impl Replaced { - #[inline] - pub fn get_mAccessor(&self) -> &::std::os::raw::c_int { &self.mAccessor } - #[inline] - pub fn get_mAccessor_mut(&mut self) -> &mut ::std::os::raw::c_int { - &mut self.mAccessor - } -} -/** <div rustbindgen accessor></div> */ -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Wrapper { - pub mReplaced: Replaced, -} -#[test] -fn bindgen_test_layout_Wrapper() { - assert_eq!(::std::mem::size_of::<Wrapper>() , 4usize); - assert_eq!(::std::mem::align_of::<Wrapper>() , 4usize); -} -impl Clone for Wrapper { - fn clone(&self) -> Self { *self } -} -impl Wrapper { - #[inline] - pub fn get_mReplaced(&self) -> &Replaced { &self.mReplaced } - #[inline] - pub fn get_mReplaced_mut(&mut self) -> &mut Replaced { - &mut self.mReplaced - } -} diff --git a/libbindgen/tests/expectations/tests/annotation_hide.rs b/libbindgen/tests/expectations/tests/annotation_hide.rs deleted file mode 100644 index dcaf7997..00000000 --- a/libbindgen/tests/expectations/tests/annotation_hide.rs +++ /dev/null @@ -1,35 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -/** - * <div rustbindgen opaque></div> - */ -#[repr(C)] -#[derive(Debug, Copy)] -pub struct D { - pub _bindgen_opaque_blob: u32, -} -#[test] -fn bindgen_test_layout_D() { - assert_eq!(::std::mem::size_of::<D>() , 4usize); - assert_eq!(::std::mem::align_of::<D>() , 4usize); -} -impl Clone for D { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct NotAnnotated { - pub f: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_NotAnnotated() { - assert_eq!(::std::mem::size_of::<NotAnnotated>() , 4usize); - assert_eq!(::std::mem::align_of::<NotAnnotated>() , 4usize); -} -impl Clone for NotAnnotated { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/anon_enum.rs b/libbindgen/tests/expectations/tests/anon_enum.rs deleted file mode 100644 index 3b05eab8..00000000 --- a/libbindgen/tests/expectations/tests/anon_enum.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Test { - pub foo: ::std::os::raw::c_int, - pub bar: f32, -} -pub const Test_T_NONE: Test__bindgen_ty_1 = Test__bindgen_ty_1::T_NONE; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Test__bindgen_ty_1 { T_NONE = 0, } -#[test] -fn bindgen_test_layout_Test() { - assert_eq!(::std::mem::size_of::<Test>() , 8usize); - assert_eq!(::std::mem::align_of::<Test>() , 4usize); -} -impl Clone for Test { - fn clone(&self) -> Self { *self } -} -pub const Foo: _bindgen_ty_1 = _bindgen_ty_1::Foo; -pub const Bar: _bindgen_ty_1 = _bindgen_ty_1::Bar; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_1 { Foo = 0, Bar = 1, } -pub use self::_bindgen_ty_1 as Baz; diff --git a/libbindgen/tests/expectations/tests/anon_enum_trait.rs b/libbindgen/tests/expectations/tests/anon_enum_trait.rs deleted file mode 100644 index 8198bc15..00000000 --- a/libbindgen/tests/expectations/tests/anon_enum_trait.rs +++ /dev/null @@ -1,47 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct DataType<_Tp> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<_Tp>, -} -pub type DataType_value_type<_Tp> = _Tp; -pub type DataType_work_type<_Tp> = DataType_value_type<_Tp>; -pub type DataType_channel_type<_Tp> = DataType_value_type<_Tp>; -pub type DataType_vec_type<_Tp> = DataType_value_type<_Tp>; -pub const DataType_generic_type: DataType__bindgen_ty_1 = - DataType__bindgen_ty_1::generic_type; -pub const DataType_depth: DataType__bindgen_ty_1 = - DataType__bindgen_ty_1::generic_type; -pub const DataType_channels: DataType__bindgen_ty_1 = - DataType__bindgen_ty_1::generic_type; -pub const DataType_fmt: DataType__bindgen_ty_1 = - DataType__bindgen_ty_1::generic_type; -pub const DataType_type_: DataType__bindgen_ty_1 = - DataType__bindgen_ty_1::generic_type; -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum DataType__bindgen_ty_1 { generic_type = 0, } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Foo { - pub _address: u8, -} -pub const Foo_Bar: Foo__bindgen_ty_1 = Foo__bindgen_ty_1::Bar; -pub const Foo_Baz: Foo__bindgen_ty_1 = Foo__bindgen_ty_1::Bar; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Foo__bindgen_ty_1 { Bar = 0, } -#[test] -fn bindgen_test_layout_Foo() { - assert_eq!(::std::mem::size_of::<Foo>() , 1usize); - assert_eq!(::std::mem::align_of::<Foo>() , 1usize); -} -impl Clone for Foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/anon_enum_whitelist.rs b/libbindgen/tests/expectations/tests/anon_enum_whitelist.rs deleted file mode 100644 index b32396a0..00000000 --- a/libbindgen/tests/expectations/tests/anon_enum_whitelist.rs +++ /dev/null @@ -1,11 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const NODE_FLAG_FOO: _bindgen_ty_1 = _bindgen_ty_1::NODE_FLAG_FOO; -pub const NODE_FLAG_BAR: _bindgen_ty_1 = _bindgen_ty_1::NODE_FLAG_BAR; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_1 { NODE_FLAG_FOO = 0, NODE_FLAG_BAR = 1, } diff --git a/libbindgen/tests/expectations/tests/anon_union.rs b/libbindgen/tests/expectations/tests/anon_union.rs deleted file mode 100644 index f8559ca9..00000000 --- a/libbindgen/tests/expectations/tests/anon_union.rs +++ /dev/null @@ -1,84 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TErrorResult<T> { - pub mResult: ::std::os::raw::c_int, - pub __bindgen_anon_1: TErrorResult__bindgen_ty_1<T>, - pub mMightHaveUnreported: bool, - pub mUnionState: TErrorResult_UnionState, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -pub const TErrorResult_UnionState_HasException: TErrorResult_UnionState = - TErrorResult_UnionState::HasMessage; -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TErrorResult_UnionState { HasMessage = 0, } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TErrorResult_Message<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TErrorResult_DOMExceptionInfo<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TErrorResult__bindgen_ty_1<T> { - pub mMessage: __BindgenUnionField<*mut TErrorResult_Message<T>>, - pub mDOMExceptionInfo: __BindgenUnionField<*mut TErrorResult_DOMExceptionInfo<T>>, - pub bindgen_union_field: u64, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct ErrorResult { - pub _base: TErrorResult<::std::os::raw::c_int>, -} -#[test] -fn bindgen_test_layout_ErrorResult() { - assert_eq!(::std::mem::size_of::<ErrorResult>() , 24usize); - assert_eq!(::std::mem::align_of::<ErrorResult>() , 8usize); -} -impl Clone for ErrorResult { - fn clone(&self) -> Self { *self } -} -#[test] -fn __bindgen_test_layout_template_1() { - assert_eq!(::std::mem::size_of::<TErrorResult<::std::os::raw::c_int>>() , - 24usize); - assert_eq!(::std::mem::align_of::<TErrorResult<::std::os::raw::c_int>>() , - 8usize); -} diff --git a/libbindgen/tests/expectations/tests/arg_keyword.rs b/libbindgen/tests/expectations/tests/arg_keyword.rs deleted file mode 100644 index cb1cc432..00000000 --- a/libbindgen/tests/expectations/tests/arg_keyword.rs +++ /dev/null @@ -1,10 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - #[link_name = "_Z3fooPKc"] - pub fn foo(type_: *const ::std::os::raw::c_char); -} diff --git a/libbindgen/tests/expectations/tests/auto.rs b/libbindgen/tests/expectations/tests/auto.rs deleted file mode 100644 index 6224e807..00000000 --- a/libbindgen/tests/expectations/tests/auto.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Foo { - pub _address: u8, -} -pub const Foo_kFoo: bool = true; -#[test] -fn bindgen_test_layout_Foo() { - assert_eq!(::std::mem::size_of::<Foo>() , 1usize); - assert_eq!(::std::mem::align_of::<Foo>() , 1usize); -} -impl Clone for Foo { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Bar<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -extern "C" { - #[link_name = "_Z5Test2v"] - pub fn Test2() -> ::std::os::raw::c_uint; -} diff --git a/libbindgen/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs b/libbindgen/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs deleted file mode 100644 index 553879b7..00000000 --- a/libbindgen/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct std_char_traits<_CharT> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<_CharT>, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct __gnu_cxx_char_traits { - pub _address: u8, -} -impl Clone for __gnu_cxx_char_traits { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/base-to-derived.rs b/libbindgen/tests/expectations/tests/base-to-derived.rs deleted file mode 100644 index c2af2c43..00000000 --- a/libbindgen/tests/expectations/tests/base-to-derived.rs +++ /dev/null @@ -1,19 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct false_type { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_false_type() { - assert_eq!(::std::mem::size_of::<false_type>() , 1usize); - assert_eq!(::std::mem::align_of::<false_type>() , 1usize); -} -impl Clone for false_type { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/bitfield-enum-basic.rs b/libbindgen/tests/expectations/tests/bitfield-enum-basic.rs deleted file mode 100644 index 03e07de6..00000000 --- a/libbindgen/tests/expectations/tests/bitfield-enum-basic.rs +++ /dev/null @@ -1,77 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const Foo_Bar: Foo = Foo(2); -pub const Foo_Baz: Foo = Foo(4); -pub const Foo_Duplicated: Foo = Foo(4); -pub const Foo_Negative: Foo = Foo(-3); -impl ::std::ops::BitOr<Foo> for Foo { - type - Output - = - Self; - #[inline] - fn bitor(self, other: Self) -> Self { Foo(self.0 | other.0) } -} -#[repr(C)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub struct Foo(pub i32); -pub const Buz_Bar: Buz = Buz(2); -pub const Buz_Baz: Buz = Buz(4); -pub const Buz_Duplicated: Buz = Buz(4); -pub const Buz_Negative: Buz = Buz(-3); -impl ::std::ops::BitOr<Buz> for Buz { - type - Output - = - Self; - #[inline] - fn bitor(self, other: Self) -> Self { Buz(self.0 | other.0) } -} -#[repr(C)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub struct Buz(pub i8); -pub const NS_FOO: _bindgen_ty_1 = _bindgen_ty_1(1); -pub const NS_BAR: _bindgen_ty_1 = _bindgen_ty_1(2); -impl ::std::ops::BitOr<_bindgen_ty_1> for _bindgen_ty_1 { - type - Output - = - Self; - #[inline] - fn bitor(self, other: Self) -> Self { _bindgen_ty_1(self.0 | other.0) } -} -#[repr(C)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub struct _bindgen_ty_1(pub u32); -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Dummy { - pub _address: u8, -} -pub const Dummy_DUMMY_FOO: Dummy__bindgen_ty_1 = Dummy__bindgen_ty_1(1); -pub const Dummy_DUMMY_BAR: Dummy__bindgen_ty_1 = Dummy__bindgen_ty_1(2); -impl ::std::ops::BitOr<Dummy__bindgen_ty_1> for Dummy__bindgen_ty_1 { - type - Output - = - Self; - #[inline] - fn bitor(self, other: Self) -> Self { - Dummy__bindgen_ty_1(self.0 | other.0) - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub struct Dummy__bindgen_ty_1(pub u32); -#[test] -fn bindgen_test_layout_Dummy() { - assert_eq!(::std::mem::size_of::<Dummy>() , 1usize); - assert_eq!(::std::mem::align_of::<Dummy>() , 1usize); -} -impl Clone for Dummy { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/bitfield_method_mangling.rs b/libbindgen/tests/expectations/tests/bitfield_method_mangling.rs deleted file mode 100644 index b650a38f..00000000 --- a/libbindgen/tests/expectations/tests/bitfield_method_mangling.rs +++ /dev/null @@ -1,49 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct _bindgen_ty_1 { - pub _bitfield_1: u32, -} -#[test] -fn bindgen_test_layout__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<_bindgen_ty_1>() , 4usize); - assert_eq!(::std::mem::align_of::<_bindgen_ty_1>() , 4usize); -} -impl Clone for _bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -impl _bindgen_ty_1 { - #[inline] - pub fn pad3(&self) -> ::std::os::raw::c_uint { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & (16777215usize as u32)) - >> 0u32) as u32) - } - } - #[inline] - pub fn set_pad3(&mut self, val: ::std::os::raw::c_uint) { - self._bitfield_1 &= !(16777215usize as u32); - self._bitfield_1 |= - ((val as u32 as u32) << 0u32) & (16777215usize as u32); - } - #[inline] - pub fn type_(&self) -> ::std::os::raw::c_uint { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & - (4278190080usize as u32)) >> 24u32) as - u32) - } - } - #[inline] - pub fn set_type(&mut self, val: ::std::os::raw::c_uint) { - self._bitfield_1 &= !(4278190080usize as u32); - self._bitfield_1 |= - ((val as u32 as u32) << 24u32) & (4278190080usize as u32); - } -} -pub use self::_bindgen_ty_1 as mach_msg_type_descriptor_t; diff --git a/libbindgen/tests/expectations/tests/blocks.rs b/libbindgen/tests/expectations/tests/blocks.rs deleted file mode 100644 index 528ea518..00000000 --- a/libbindgen/tests/expectations/tests/blocks.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - pub fn atexit_b(arg1: *mut ::std::os::raw::c_void); -} diff --git a/libbindgen/tests/expectations/tests/canonical_path_without_namespacing.rs b/libbindgen/tests/expectations/tests/canonical_path_without_namespacing.rs deleted file mode 100644 index 0b1f561c..00000000 --- a/libbindgen/tests/expectations/tests/canonical_path_without_namespacing.rs +++ /dev/null @@ -1,23 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Bar { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 1usize); - assert_eq!(::std::mem::align_of::<Bar>() , 1usize); -} -impl Clone for Bar { - fn clone(&self) -> Self { *self } -} -extern "C" { - #[link_name = "_Z3bazPN3foo3BarE"] - pub fn baz(arg1: *mut Bar); -} diff --git a/libbindgen/tests/expectations/tests/class.rs b/libbindgen/tests/expectations/tests/class.rs deleted file mode 100644 index 579c24a4..00000000 --- a/libbindgen/tests/expectations/tests/class.rs +++ /dev/null @@ -1,127 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -pub struct C { - pub a: ::std::os::raw::c_int, - pub big_array: [::std::os::raw::c_char; 33usize], -} -#[test] -fn bindgen_test_layout_C() { - assert_eq!(::std::mem::size_of::<C>() , 40usize); - assert_eq!(::std::mem::align_of::<C>() , 4usize); -} -#[repr(C)] -#[derive(Debug)] -pub struct WithDtor { - pub b: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_WithDtor() { - assert_eq!(::std::mem::size_of::<WithDtor>() , 4usize); - assert_eq!(::std::mem::align_of::<WithDtor>() , 4usize); -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Union { - pub d: __BindgenUnionField<f32>, - pub i: __BindgenUnionField<::std::os::raw::c_int>, - pub bindgen_union_field: u32, -} -#[test] -fn bindgen_test_layout_Union() { - assert_eq!(::std::mem::size_of::<Union>() , 4usize); - assert_eq!(::std::mem::align_of::<Union>() , 4usize); -} -impl Clone for Union { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct WithUnion { - pub data: Union, -} -#[test] -fn bindgen_test_layout_WithUnion() { - assert_eq!(::std::mem::size_of::<WithUnion>() , 4usize); - assert_eq!(::std::mem::align_of::<WithUnion>() , 4usize); -} -impl Clone for WithUnion { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct RealAbstractionWithTonsOfMethods { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_RealAbstractionWithTonsOfMethods() { - assert_eq!(::std::mem::size_of::<RealAbstractionWithTonsOfMethods>() , - 1usize); - assert_eq!(::std::mem::align_of::<RealAbstractionWithTonsOfMethods>() , - 1usize); -} -extern "C" { - #[link_name = "_ZNK32RealAbstractionWithTonsOfMethods3barEv"] - pub fn RealAbstractionWithTonsOfMethods_bar(this: - *const RealAbstractionWithTonsOfMethods); -} -extern "C" { - #[link_name = "_ZN32RealAbstractionWithTonsOfMethods3barEv"] - pub fn RealAbstractionWithTonsOfMethods_bar1(this: - *mut RealAbstractionWithTonsOfMethods); -} -extern "C" { - #[link_name = "_ZN32RealAbstractionWithTonsOfMethods3barEi"] - pub fn RealAbstractionWithTonsOfMethods_bar2(this: - *mut RealAbstractionWithTonsOfMethods, - foo: ::std::os::raw::c_int); -} -extern "C" { - #[link_name = "_ZN32RealAbstractionWithTonsOfMethods3staEv"] - pub fn RealAbstractionWithTonsOfMethods_sta(); -} -impl Clone for RealAbstractionWithTonsOfMethods { - fn clone(&self) -> Self { *self } -} -impl RealAbstractionWithTonsOfMethods { - #[inline] - pub unsafe fn bar(&self) { RealAbstractionWithTonsOfMethods_bar(&*self) } - #[inline] - pub unsafe fn bar1(&mut self) { - RealAbstractionWithTonsOfMethods_bar1(&mut *self) - } - #[inline] - pub unsafe fn bar2(&mut self, foo: ::std::os::raw::c_int) { - RealAbstractionWithTonsOfMethods_bar2(&mut *self, foo) - } - #[inline] - pub unsafe fn sta() { RealAbstractionWithTonsOfMethods_sta() } -} diff --git a/libbindgen/tests/expectations/tests/class_nested.rs b/libbindgen/tests/expectations/tests/class_nested.rs deleted file mode 100644 index 593e156d..00000000 --- a/libbindgen/tests/expectations/tests/class_nested.rs +++ /dev/null @@ -1,59 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct A { - pub member_a: ::std::os::raw::c_int, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct A_B { - pub member_b: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_A_B() { - assert_eq!(::std::mem::size_of::<A_B>() , 4usize); - assert_eq!(::std::mem::align_of::<A_B>() , 4usize); -} -impl Clone for A_B { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_A() { - assert_eq!(::std::mem::size_of::<A>() , 4usize); - assert_eq!(::std::mem::align_of::<A>() , 4usize); -} -impl Clone for A { - fn clone(&self) -> Self { *self } -} -extern "C" { - #[link_name = "var"] - pub static mut var: A_B; -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct D { - pub member: A_B, -} -#[test] -fn bindgen_test_layout_D() { - assert_eq!(::std::mem::size_of::<D>() , 4usize); - assert_eq!(::std::mem::align_of::<D>() , 4usize); -} -impl Clone for D { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Templated<T> { - pub member: T, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Templated_Templated_inner<T> { - pub member_ptr: *mut T, -} diff --git a/libbindgen/tests/expectations/tests/class_no_members.rs b/libbindgen/tests/expectations/tests/class_no_members.rs deleted file mode 100644 index 017f7c22..00000000 --- a/libbindgen/tests/expectations/tests/class_no_members.rs +++ /dev/null @@ -1,45 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct whatever { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_whatever() { - assert_eq!(::std::mem::size_of::<whatever>() , 1usize); - assert_eq!(::std::mem::align_of::<whatever>() , 1usize); -} -impl Clone for whatever { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct whatever_child { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_whatever_child() { - assert_eq!(::std::mem::size_of::<whatever_child>() , 1usize); - assert_eq!(::std::mem::align_of::<whatever_child>() , 1usize); -} -impl Clone for whatever_child { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct whatever_child_with_member { - pub m_member: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_whatever_child_with_member() { - assert_eq!(::std::mem::size_of::<whatever_child_with_member>() , 4usize); - assert_eq!(::std::mem::align_of::<whatever_child_with_member>() , 4usize); -} -impl Clone for whatever_child_with_member { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/class_static.rs b/libbindgen/tests/expectations/tests/class_static.rs deleted file mode 100644 index 8108be2d..00000000 --- a/libbindgen/tests/expectations/tests/class_static.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct MyClass { - pub _address: u8, -} -extern "C" { - #[link_name = "_ZN7MyClass7exampleE"] - pub static mut MyClass_example: *const ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "_ZN7MyClass26example_check_no_collisionE"] - pub static mut MyClass_example_check_no_collision: - *const ::std::os::raw::c_int; -} -#[test] -fn bindgen_test_layout_MyClass() { - assert_eq!(::std::mem::size_of::<MyClass>() , 1usize); - assert_eq!(::std::mem::align_of::<MyClass>() , 1usize); -} -impl Clone for MyClass { - fn clone(&self) -> Self { *self } -} -extern "C" { - #[link_name = "_ZL26example_check_no_collision"] - pub static mut example_check_no_collision: *const ::std::os::raw::c_int; -} diff --git a/libbindgen/tests/expectations/tests/class_static_const.rs b/libbindgen/tests/expectations/tests/class_static_const.rs deleted file mode 100644 index eed6590c..00000000 --- a/libbindgen/tests/expectations/tests/class_static_const.rs +++ /dev/null @@ -1,22 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct A { - pub _address: u8, -} -pub const A_a: ::std::os::raw::c_int = 0; -pub const A_b: i32 = 63; -pub const A_c: u32 = 255; -#[test] -fn bindgen_test_layout_A() { - assert_eq!(::std::mem::size_of::<A>() , 1usize); - assert_eq!(::std::mem::align_of::<A>() , 1usize); -} -impl Clone for A { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/class_use_as.rs b/libbindgen/tests/expectations/tests/class_use_as.rs deleted file mode 100644 index c3843b31..00000000 --- a/libbindgen/tests/expectations/tests/class_use_as.rs +++ /dev/null @@ -1,35 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -/** - * <div rustbindgen="true" replaces="whatever"></div> - */ -#[repr(C)] -#[derive(Debug, Copy)] -pub struct whatever { - pub replacement: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_whatever() { - assert_eq!(::std::mem::size_of::<whatever>() , 4usize); - assert_eq!(::std::mem::align_of::<whatever>() , 4usize); -} -impl Clone for whatever { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct container { - pub c: whatever, -} -#[test] -fn bindgen_test_layout_container() { - assert_eq!(::std::mem::size_of::<container>() , 4usize); - assert_eq!(::std::mem::align_of::<container>() , 4usize); -} -impl Clone for container { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/class_with_dtor.rs b/libbindgen/tests/expectations/tests/class_with_dtor.rs deleted file mode 100644 index 8fa0951f..00000000 --- a/libbindgen/tests/expectations/tests/class_with_dtor.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug)] -pub struct HandleWithDtor<T> { - pub ptr: *mut T, -} -pub type HandleValue = HandleWithDtor<::std::os::raw::c_int>; -#[repr(C)] -#[derive(Debug)] -pub struct WithoutDtor { - pub shouldBeWithDtor: HandleValue, -} -#[test] -fn bindgen_test_layout_WithoutDtor() { - assert_eq!(::std::mem::size_of::<WithoutDtor>() , 8usize); - assert_eq!(::std::mem::align_of::<WithoutDtor>() , 8usize); -} -#[test] -fn __bindgen_test_layout_template_1() { - assert_eq!(::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>() - , 8usize); - assert_eq!(::std::mem::align_of::<HandleWithDtor<::std::os::raw::c_int>>() - , 8usize); -} diff --git a/libbindgen/tests/expectations/tests/class_with_inner_struct.rs b/libbindgen/tests/expectations/tests/class_with_inner_struct.rs deleted file mode 100644 index a1bacbdb..00000000 --- a/libbindgen/tests/expectations/tests/class_with_inner_struct.rs +++ /dev/null @@ -1,199 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct A { - pub c: ::std::os::raw::c_uint, - pub named_union: A__bindgen_ty_1, - pub __bindgen_anon_1: A__bindgen_ty_2, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct A_Segment { - pub begin: ::std::os::raw::c_int, - pub end: ::std::os::raw::c_int, -} -#[test] -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 A__bindgen_ty_1 { - pub f: __BindgenUnionField<::std::os::raw::c_int>, - pub bindgen_union_field: u32, -} -#[test] -fn bindgen_test_layout_A__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<A__bindgen_ty_1>() , 4usize); - assert_eq!(::std::mem::align_of::<A__bindgen_ty_1>() , 4usize); -} -impl Clone for A__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct A__bindgen_ty_2 { - pub d: __BindgenUnionField<::std::os::raw::c_int>, - pub bindgen_union_field: u32, -} -#[test] -fn bindgen_test_layout_A__bindgen_ty_2() { - assert_eq!(::std::mem::size_of::<A__bindgen_ty_2>() , 4usize); - assert_eq!(::std::mem::align_of::<A__bindgen_ty_2>() , 4usize); -} -impl Clone for A__bindgen_ty_2 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_A() { - assert_eq!(::std::mem::size_of::<A>() , 12usize); - assert_eq!(::std::mem::align_of::<A>() , 4usize); -} -impl Clone for A { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct B { - pub d: ::std::os::raw::c_uint, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct B_Segment { - pub begin: ::std::os::raw::c_int, - pub end: ::std::os::raw::c_int, -} -#[test] -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 Clone for B_Segment { - fn clone(&self) -> Self { *self } -} -#[test] -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, PartialEq, Eq, Hash)] -pub enum StepSyntax { - Keyword = 0, - FunctionalWithoutKeyword = 1, - FunctionalWithStartKeyword = 2, - FunctionalWithEndKeyword = 3, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C { - pub d: ::std::os::raw::c_uint, - pub __bindgen_anon_1: C__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C__bindgen_ty_1 { - pub mFunc: __BindgenUnionField<C__bindgen_ty_1__bindgen_ty_1>, - pub __bindgen_anon_1: __BindgenUnionField<C__bindgen_ty_1__bindgen_ty_2>, - pub bindgen_union_field: [u32; 4usize], -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C__bindgen_ty_1__bindgen_ty_1 { - pub mX1: f32, - pub mY1: f32, - pub mX2: f32, - pub mY2: f32, -} -#[test] -fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<C__bindgen_ty_1__bindgen_ty_1>() , - 16usize); - assert_eq!(::std::mem::align_of::<C__bindgen_ty_1__bindgen_ty_1>() , - 4usize); -} -impl Clone for C__bindgen_ty_1__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C__bindgen_ty_1__bindgen_ty_2 { - pub mStepSyntax: StepSyntax, - pub mSteps: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_2() { - assert_eq!(::std::mem::size_of::<C__bindgen_ty_1__bindgen_ty_2>() , - 8usize); - assert_eq!(::std::mem::align_of::<C__bindgen_ty_1__bindgen_ty_2>() , - 4usize); -} -impl Clone for C__bindgen_ty_1__bindgen_ty_2 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_C__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<C__bindgen_ty_1>() , 16usize); - assert_eq!(::std::mem::align_of::<C__bindgen_ty_1>() , 4usize); -} -impl Clone for C__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C_Segment { - pub begin: ::std::os::raw::c_int, - pub end: ::std::os::raw::c_int, -} -#[test] -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 Clone for C_Segment { - fn clone(&self) -> Self { *self } -} -#[test] -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 } -} diff --git a/libbindgen/tests/expectations/tests/class_with_typedef.rs b/libbindgen/tests/expectations/tests/class_with_typedef.rs deleted file mode 100644 index bc19f2bd..00000000 --- a/libbindgen/tests/expectations/tests/class_with_typedef.rs +++ /dev/null @@ -1,72 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type AnotherInt = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C { - pub c: C_MyInt, - pub ptr: *mut C_MyInt, - pub arr: [C_MyInt; 10usize], - pub d: AnotherInt, - pub other_ptr: *mut AnotherInt, -} -pub type C_MyInt = ::std::os::raw::c_int; -pub type C_Lookup = *const ::std::os::raw::c_char; -#[test] -fn bindgen_test_layout_C() { - assert_eq!(::std::mem::size_of::<C>() , 72usize); - assert_eq!(::std::mem::align_of::<C>() , 8usize); -} -extern "C" { - #[link_name = "_ZN1C6methodEi"] - pub fn C_method(this: *mut C, c: C_MyInt); -} -extern "C" { - #[link_name = "_ZN1C9methodRefERi"] - pub fn C_methodRef(this: *mut C, c: *mut C_MyInt); -} -extern "C" { - #[link_name = "_ZN1C16complexMethodRefERPKc"] - pub fn C_complexMethodRef(this: *mut C, c: *mut C_Lookup); -} -extern "C" { - #[link_name = "_ZN1C13anotherMethodEi"] - pub fn C_anotherMethod(this: *mut C, c: AnotherInt); -} -impl Clone for C { - fn clone(&self) -> Self { *self } -} -impl C { - #[inline] - pub unsafe fn method(&mut self, c: C_MyInt) { C_method(&mut *self, c) } - #[inline] - pub unsafe fn methodRef(&mut self, c: *mut C_MyInt) { - C_methodRef(&mut *self, c) - } - #[inline] - pub unsafe fn complexMethodRef(&mut self, c: *mut C_Lookup) { - C_complexMethodRef(&mut *self, c) - } - #[inline] - pub unsafe fn anotherMethod(&mut self, c: AnotherInt) { - C_anotherMethod(&mut *self, c) - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct D { - pub _base: C, - pub ptr: *mut C_MyInt, -} -#[test] -fn bindgen_test_layout_D() { - assert_eq!(::std::mem::size_of::<D>() , 80usize); - assert_eq!(::std::mem::align_of::<D>() , 8usize); -} -impl Clone for D { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/complex.rs b/libbindgen/tests/expectations/tests/complex.rs deleted file mode 100644 index f2a97952..00000000 --- a/libbindgen/tests/expectations/tests/complex.rs +++ /dev/null @@ -1,64 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)] -#[repr(C)] -pub struct __BindgenComplex<T> { - pub re: T, - pub im: T, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TestDouble { - pub mMember: __BindgenComplex<f64>, -} -#[test] -fn bindgen_test_layout_TestDouble() { - assert_eq!(::std::mem::size_of::<TestDouble>() , 16usize); - assert_eq!(::std::mem::align_of::<TestDouble>() , 8usize); -} -impl Clone for TestDouble { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TestDoublePtr { - pub mMember: *mut __BindgenComplex<f64>, -} -#[test] -fn bindgen_test_layout_TestDoublePtr() { - assert_eq!(::std::mem::size_of::<TestDoublePtr>() , 8usize); - assert_eq!(::std::mem::align_of::<TestDoublePtr>() , 8usize); -} -impl Clone for TestDoublePtr { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TestFloat { - pub mMember: __BindgenComplex<f32>, -} -#[test] -fn bindgen_test_layout_TestFloat() { - assert_eq!(::std::mem::size_of::<TestFloat>() , 8usize); - assert_eq!(::std::mem::align_of::<TestFloat>() , 4usize); -} -impl Clone for TestFloat { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TestFloatPtr { - pub mMember: *mut __BindgenComplex<f32>, -} -#[test] -fn bindgen_test_layout_TestFloatPtr() { - assert_eq!(::std::mem::size_of::<TestFloatPtr>() , 8usize); - assert_eq!(::std::mem::align_of::<TestFloatPtr>() , 8usize); -} -impl Clone for TestFloatPtr { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/complex_global.rs b/libbindgen/tests/expectations/tests/complex_global.rs deleted file mode 100644 index badc4d1f..00000000 --- a/libbindgen/tests/expectations/tests/complex_global.rs +++ /dev/null @@ -1,24 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)] -#[repr(C)] -pub struct __BindgenComplex<T> { - pub re: T, - pub im: T, -} -extern "C" { - #[link_name = "globalValueFloat"] - pub static mut globalValueFloat: __BindgenComplex<f32>; -} -extern "C" { - #[link_name = "globalValueDouble"] - pub static mut globalValueDouble: __BindgenComplex<f64>; -} -extern "C" { - #[link_name = "globalValueLongDouble"] - pub static mut globalValueLongDouble: __BindgenComplex<f64>; -} diff --git a/libbindgen/tests/expectations/tests/const_bool.rs b/libbindgen/tests/expectations/tests/const_bool.rs deleted file mode 100644 index 8a50a094..00000000 --- a/libbindgen/tests/expectations/tests/const_bool.rs +++ /dev/null @@ -1,23 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const k: bool = true; -#[repr(C)] -#[derive(Debug, Copy)] -pub struct A { - pub _address: u8, -} -pub const A_k: bool = false; -#[test] -fn bindgen_test_layout_A() { - assert_eq!(::std::mem::size_of::<A>() , 1usize); - assert_eq!(::std::mem::align_of::<A>() , 1usize); -} -impl Clone for A { - fn clone(&self) -> Self { *self } -} -pub type foo = bool; -pub const k2: foo = true; diff --git a/libbindgen/tests/expectations/tests/const_enum_unnamed.rs b/libbindgen/tests/expectations/tests/const_enum_unnamed.rs deleted file mode 100644 index 0bd3987a..00000000 --- a/libbindgen/tests/expectations/tests/const_enum_unnamed.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const FOO_BAR: _bindgen_ty_1 = _bindgen_ty_1::FOO_BAR; -pub const FOO_BAZ: _bindgen_ty_1 = _bindgen_ty_1::FOO_BAZ; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_1 { FOO_BAR = 0, FOO_BAZ = 1, } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Foo { - pub _address: u8, -} -pub const Foo_FOO_BAR: Foo__bindgen_ty_1 = Foo__bindgen_ty_1::FOO_BAR; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Foo__bindgen_ty_1 { FOO_BAR = 10, } -#[test] -fn bindgen_test_layout_Foo() { - assert_eq!(::std::mem::size_of::<Foo>() , 1usize); - assert_eq!(::std::mem::align_of::<Foo>() , 1usize); -} -impl Clone for Foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/const_ptr.rs b/libbindgen/tests/expectations/tests/const_ptr.rs deleted file mode 100644 index 89400df1..00000000 --- a/libbindgen/tests/expectations/tests/const_ptr.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - pub fn foo(bar: *const ::std::os::raw::c_void); -} diff --git a/libbindgen/tests/expectations/tests/const_resolved_ty.rs b/libbindgen/tests/expectations/tests/const_resolved_ty.rs deleted file mode 100644 index 77d8f438..00000000 --- a/libbindgen/tests/expectations/tests/const_resolved_ty.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - pub fn foo(foo: *const u8); -} diff --git a/libbindgen/tests/expectations/tests/const_tparam.rs b/libbindgen/tests/expectations/tests/const_tparam.rs deleted file mode 100644 index 3ed10d28..00000000 --- a/libbindgen/tests/expectations/tests/const_tparam.rs +++ /dev/null @@ -1,12 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct C<T> { - pub foo: *const T, - pub bar: *mut T, -} diff --git a/libbindgen/tests/expectations/tests/constant-evaluate.rs b/libbindgen/tests/expectations/tests/constant-evaluate.rs deleted file mode 100644 index cdf097a2..00000000 --- a/libbindgen/tests/expectations/tests/constant-evaluate.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo; -pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_1 { foo = 4, bar = 8, } -pub type EasyToOverflow = ::std::os::raw::c_ulonglong; -pub const k: EasyToOverflow = 2147483648; -pub const k_expr: EasyToOverflow = 0; -pub const BAZ: ::std::os::raw::c_longlong = 24; -pub const fuzz: f64 = 51.; -pub const BAZZ: ::std::os::raw::c_char = 53; -pub const WAT: ::std::os::raw::c_char = 0; -pub const bytestring: &'static [u8; 4usize] = b"Foo\x00"; -pub const NOT_UTF8: [u8; 5usize] = [240, 40, 140, 40, 0]; diff --git a/libbindgen/tests/expectations/tests/constify-enum.rs b/libbindgen/tests/expectations/tests/constify-enum.rs deleted file mode 100644 index 989c5197..00000000 --- a/libbindgen/tests/expectations/tests/constify-enum.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const nsCSSPropertyID_eCSSProperty_COUNT_unexistingVariantValue: - nsCSSPropertyID = - nsCSSPropertyID::eCSSProperty_COUNT_unexistingVariantValue; -pub const nsCSSPropertyID_eCSSProperty_COUNT: nsCSSPropertyID = - nsCSSPropertyID::eCSSPropertyAlias_aa; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum nsCSSPropertyID { - eCSSProperty_a = 0, - eCSSProperty_b = 1, - eCSSPropertyAlias_aa = 2, - eCSSPropertyAlias_bb = 3, - eCSSProperty_COUNT_unexistingVariantValue = 4, -} diff --git a/libbindgen/tests/expectations/tests/constructor-tp.rs b/libbindgen/tests/expectations/tests/constructor-tp.rs deleted file mode 100644 index 50220489..00000000 --- a/libbindgen/tests/expectations/tests/constructor-tp.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Foo<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Bar { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 1usize); - assert_eq!(::std::mem::align_of::<Bar>() , 1usize); -} -extern "C" { - #[link_name = "_ZN3BarC1Ev"] - pub fn Bar_Bar(this: *mut Bar); -} -impl Clone for Bar { - fn clone(&self) -> Self { *self } -} -impl Bar { - #[inline] - pub unsafe fn new() -> Self { - let mut __bindgen_tmp = ::std::mem::uninitialized(); - Bar_Bar(&mut __bindgen_tmp); - __bindgen_tmp - } -} diff --git a/libbindgen/tests/expectations/tests/constructors.rs b/libbindgen/tests/expectations/tests/constructors.rs deleted file mode 100644 index 95afb82d..00000000 --- a/libbindgen/tests/expectations/tests/constructors.rs +++ /dev/null @@ -1,67 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TestOverload { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_TestOverload() { - assert_eq!(::std::mem::size_of::<TestOverload>() , 1usize); - assert_eq!(::std::mem::align_of::<TestOverload>() , 1usize); -} -extern "C" { - #[link_name = "_ZN12TestOverloadC1Ei"] - pub fn TestOverload_TestOverload(this: *mut TestOverload, - arg1: ::std::os::raw::c_int); -} -extern "C" { - #[link_name = "_ZN12TestOverloadC1Ed"] - pub fn TestOverload_TestOverload1(this: *mut TestOverload, arg1: f64); -} -impl Clone for TestOverload { - fn clone(&self) -> Self { *self } -} -impl TestOverload { - #[inline] - pub unsafe fn new(arg1: ::std::os::raw::c_int) -> Self { - let mut __bindgen_tmp = ::std::mem::uninitialized(); - TestOverload_TestOverload(&mut __bindgen_tmp, arg1); - __bindgen_tmp - } - #[inline] - pub unsafe fn new1(arg1: f64) -> Self { - let mut __bindgen_tmp = ::std::mem::uninitialized(); - TestOverload_TestOverload1(&mut __bindgen_tmp, arg1); - __bindgen_tmp - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TestPublicNoArgs { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_TestPublicNoArgs() { - assert_eq!(::std::mem::size_of::<TestPublicNoArgs>() , 1usize); - assert_eq!(::std::mem::align_of::<TestPublicNoArgs>() , 1usize); -} -extern "C" { - #[link_name = "_ZN16TestPublicNoArgsC1Ev"] - pub fn TestPublicNoArgs_TestPublicNoArgs(this: *mut TestPublicNoArgs); -} -impl Clone for TestPublicNoArgs { - fn clone(&self) -> Self { *self } -} -impl TestPublicNoArgs { - #[inline] - pub unsafe fn new() -> Self { - let mut __bindgen_tmp = ::std::mem::uninitialized(); - TestPublicNoArgs_TestPublicNoArgs(&mut __bindgen_tmp); - __bindgen_tmp - } -} diff --git a/libbindgen/tests/expectations/tests/convert-floats.rs b/libbindgen/tests/expectations/tests/convert-floats.rs deleted file mode 100644 index 5cd38c13..00000000 --- a/libbindgen/tests/expectations/tests/convert-floats.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)] -#[repr(C)] -pub struct __BindgenComplex<T> { - pub re: T, - pub im: T, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub bar: ::std::os::raw::c_float, - pub baz: ::std::os::raw::c_float, - pub bazz: ::std::os::raw::c_double, - pub bazzz: *mut ::std::os::raw::c_double, - pub complexFloat: __BindgenComplex<::std::os::raw::c_float>, - pub complexDouble: __BindgenComplex<::std::os::raw::c_double>, -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 48usize); - assert_eq!(::std::mem::align_of::<foo>() , 8usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/crtp.rs b/libbindgen/tests/expectations/tests/crtp.rs deleted file mode 100644 index cc488fd6..00000000 --- a/libbindgen/tests/expectations/tests/crtp.rs +++ /dev/null @@ -1,55 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Base<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Derived { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Derived() { - assert_eq!(::std::mem::size_of::<Derived>() , 1usize); - assert_eq!(::std::mem::align_of::<Derived>() , 1usize); -} -impl Clone for Derived { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug)] -pub struct BaseWithDestructor<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug)] -pub struct DerivedFromBaseWithDestructor { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_DerivedFromBaseWithDestructor() { - assert_eq!(::std::mem::size_of::<DerivedFromBaseWithDestructor>() , - 1usize); - assert_eq!(::std::mem::align_of::<DerivedFromBaseWithDestructor>() , - 1usize); -} -#[test] -fn __bindgen_test_layout_template_1() { - assert_eq!(::std::mem::size_of::<Base<Derived>>() , 1usize); - assert_eq!(::std::mem::align_of::<Base<Derived>>() , 1usize); -} -#[test] -fn __bindgen_test_layout_template_2() { - assert_eq!(::std::mem::size_of::<BaseWithDestructor<DerivedFromBaseWithDestructor>>() - , 1usize); - assert_eq!(::std::mem::align_of::<BaseWithDestructor<DerivedFromBaseWithDestructor>>() - , 1usize); -} diff --git a/libbindgen/tests/expectations/tests/dash_language.rs b/libbindgen/tests/expectations/tests/dash_language.rs deleted file mode 100644 index 148f9c32..00000000 --- a/libbindgen/tests/expectations/tests/dash_language.rs +++ /dev/null @@ -1,12 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Foo<T> { - pub bar: ::std::os::raw::c_int, - pub _phantom_0: ::std::marker::PhantomData<T>, -} diff --git a/libbindgen/tests/expectations/tests/decl_extern_int_twice.rs b/libbindgen/tests/expectations/tests/decl_extern_int_twice.rs deleted file mode 100644 index 603a51b1..00000000 --- a/libbindgen/tests/expectations/tests/decl_extern_int_twice.rs +++ /dev/null @@ -1,10 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - #[link_name = "foo"] - pub static mut foo: ::std::os::raw::c_int; -} diff --git a/libbindgen/tests/expectations/tests/decl_ptr_to_array.rs b/libbindgen/tests/expectations/tests/decl_ptr_to_array.rs deleted file mode 100644 index b8abedb5..00000000 --- a/libbindgen/tests/expectations/tests/decl_ptr_to_array.rs +++ /dev/null @@ -1,10 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - #[link_name = "foo"] - pub static mut foo: *mut [::std::os::raw::c_int; 1usize]; -} diff --git a/libbindgen/tests/expectations/tests/disable-namespacing.rs b/libbindgen/tests/expectations/tests/disable-namespacing.rs deleted file mode 100644 index 5c166946..00000000 --- a/libbindgen/tests/expectations/tests/disable-namespacing.rs +++ /dev/null @@ -1,7 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type Baz = ::std::os::raw::c_int; diff --git a/libbindgen/tests/expectations/tests/duplicated-namespaces-definitions.rs b/libbindgen/tests/expectations/tests/duplicated-namespaces-definitions.rs deleted file mode 100644 index da06a2a9..00000000 --- a/libbindgen/tests/expectations/tests/duplicated-namespaces-definitions.rs +++ /dev/null @@ -1,45 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - pub mod foo { - #[allow(unused_imports)] - use self::super::super::root; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Bar { - pub foo: ::std::os::raw::c_int, - pub baz: bool, - } - #[test] - fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 8usize); - assert_eq!(::std::mem::align_of::<Bar>() , 4usize); - } - impl Clone for Bar { - fn clone(&self) -> Self { *self } - } - } - pub mod bar { - #[allow(unused_imports)] - use self::super::super::root; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Foo { - pub ptr: *mut root::foo::Bar, - } - #[test] - fn bindgen_test_layout_Foo() { - assert_eq!(::std::mem::size_of::<Foo>() , 8usize); - assert_eq!(::std::mem::align_of::<Foo>() , 8usize); - } - impl Clone for Foo { - fn clone(&self) -> Self { *self } - } - } -} diff --git a/libbindgen/tests/expectations/tests/duplicated-namespaces.rs b/libbindgen/tests/expectations/tests/duplicated-namespaces.rs deleted file mode 100644 index 42976657..00000000 --- a/libbindgen/tests/expectations/tests/duplicated-namespaces.rs +++ /dev/null @@ -1,10 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; -} diff --git a/libbindgen/tests/expectations/tests/duplicated_constants_in_ns.rs b/libbindgen/tests/expectations/tests/duplicated_constants_in_ns.rs deleted file mode 100644 index 3721740c..00000000 --- a/libbindgen/tests/expectations/tests/duplicated_constants_in_ns.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - pub mod foo { - #[allow(unused_imports)] - use self::super::super::root; - pub const FOO: ::std::os::raw::c_int = 4; - } - pub mod bar { - #[allow(unused_imports)] - use self::super::super::root; - pub const FOO: ::std::os::raw::c_int = 5; - } -} diff --git a/libbindgen/tests/expectations/tests/elaborated.rs b/libbindgen/tests/expectations/tests/elaborated.rs deleted file mode 100644 index 0e8f4ee5..00000000 --- a/libbindgen/tests/expectations/tests/elaborated.rs +++ /dev/null @@ -1,11 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type whatever_whatever_t = ::std::os::raw::c_int; -extern "C" { - #[link_name = "_Z9somethingPKi"] - pub fn something(wat: *const whatever_whatever_t); -} diff --git a/libbindgen/tests/expectations/tests/empty_template_param_name.rs b/libbindgen/tests/expectations/tests/empty_template_param_name.rs deleted file mode 100644 index e10b56db..00000000 --- a/libbindgen/tests/expectations/tests/empty_template_param_name.rs +++ /dev/null @@ -1,13 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type __void_t = ::std::os::raw::c_void; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __iterator_traits<_Iterator> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<_Iterator>, -} diff --git a/libbindgen/tests/expectations/tests/enum.rs b/libbindgen/tests/expectations/tests/enum.rs deleted file mode 100644 index 8138d697..00000000 --- a/libbindgen/tests/expectations/tests/enum.rs +++ /dev/null @@ -1,12 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Foo { Bar = 0, Qux = 1, } -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Neg { MinusOne = -1, One = 1, } diff --git a/libbindgen/tests/expectations/tests/enum_alias.rs b/libbindgen/tests/expectations/tests/enum_alias.rs deleted file mode 100644 index 7ea85598..00000000 --- a/libbindgen/tests/expectations/tests/enum_alias.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(u8)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Bar { VAL = 0, } diff --git a/libbindgen/tests/expectations/tests/enum_and_vtable_mangling.rs b/libbindgen/tests/expectations/tests/enum_and_vtable_mangling.rs deleted file mode 100644 index a55c344e..00000000 --- a/libbindgen/tests/expectations/tests/enum_and_vtable_mangling.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const match_: _bindgen_ty_1 = _bindgen_ty_1::match_; -pub const whatever_else: _bindgen_ty_1 = _bindgen_ty_1::whatever_else; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_1 { match_ = 0, whatever_else = 1, } -#[repr(C)] -pub struct C__bindgen_vtable { -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C { - pub vtable_: *const C__bindgen_vtable, - pub i: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_C() { - assert_eq!(::std::mem::size_of::<C>() , 16usize); - assert_eq!(::std::mem::align_of::<C>() , 8usize); -} -impl Clone for C { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/enum_dupe.rs b/libbindgen/tests/expectations/tests/enum_dupe.rs deleted file mode 100644 index 322b89fc..00000000 --- a/libbindgen/tests/expectations/tests/enum_dupe.rs +++ /dev/null @@ -1,10 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const Foo_Dupe: Foo = Foo::Bar; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Foo { Bar = 1, } diff --git a/libbindgen/tests/expectations/tests/enum_explicit_type.rs b/libbindgen/tests/expectations/tests/enum_explicit_type.rs deleted file mode 100644 index 4e555d3a..00000000 --- a/libbindgen/tests/expectations/tests/enum_explicit_type.rs +++ /dev/null @@ -1,24 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(u8)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Foo { Bar = 0, Qux = 1, } -#[repr(i8)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Neg { MinusOne = -1, One = 1, } -#[repr(u16)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Bigger { Much = 255, Larger = 256, } -#[repr(i64)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum MuchLong { MuchLow = -4294967296, } -#[repr(i64)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum MuchLongLong { I64_MIN = -9223372036854775808, } -#[repr(u64)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum MuchULongLong { MuchHigh = 4294967296, } diff --git a/libbindgen/tests/expectations/tests/enum_in_template_with_typedef.rs b/libbindgen/tests/expectations/tests/enum_in_template_with_typedef.rs deleted file mode 100644 index 66a304aa..00000000 --- a/libbindgen/tests/expectations/tests/enum_in_template_with_typedef.rs +++ /dev/null @@ -1,18 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct std_fbstring_core<Char> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<Char>, -} -pub type std_fbstring_core_category_type = u8; -pub const std_fbstring_core_Category_Bar: std_fbstring_core_Category = - std_fbstring_core_Category::Foo; -#[repr(u8)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum std_fbstring_core_Category { Foo = 0, } diff --git a/libbindgen/tests/expectations/tests/enum_negative.rs b/libbindgen/tests/expectations/tests/enum_negative.rs deleted file mode 100644 index 74cf4f16..00000000 --- a/libbindgen/tests/expectations/tests/enum_negative.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Foo { Bar = -2, Qux = 1, } diff --git a/libbindgen/tests/expectations/tests/enum_packed.rs b/libbindgen/tests/expectations/tests/enum_packed.rs deleted file mode 100644 index 963763e1..00000000 --- a/libbindgen/tests/expectations/tests/enum_packed.rs +++ /dev/null @@ -1,15 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(u8)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Foo { Bar = 0, Qux = 1, } -#[repr(i8)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Neg { MinusOne = -1, One = 1, } -#[repr(u16)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Bigger { Much = 255, Larger = 256, } diff --git a/libbindgen/tests/expectations/tests/eval-variadic-template-parameter.rs b/libbindgen/tests/expectations/tests/eval-variadic-template-parameter.rs deleted file mode 100644 index f8c937e2..00000000 --- a/libbindgen/tests/expectations/tests/eval-variadic-template-parameter.rs +++ /dev/null @@ -1,12 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct B<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} diff --git a/libbindgen/tests/expectations/tests/extern.rs b/libbindgen/tests/expectations/tests/extern.rs deleted file mode 100644 index e7ac7504..00000000 --- a/libbindgen/tests/expectations/tests/extern.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type foo = - ::std::option::Option<unsafe extern "C" fn(bar: ::std::os::raw::c_int) - -> ::std::os::raw::c_int>; diff --git a/libbindgen/tests/expectations/tests/float128.rs b/libbindgen/tests/expectations/tests/float128.rs deleted file mode 100644 index b4b7b2bc..00000000 --- a/libbindgen/tests/expectations/tests/float128.rs +++ /dev/null @@ -1,7 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - - diff --git a/libbindgen/tests/expectations/tests/forward-inherit-struct-with-fields.rs b/libbindgen/tests/expectations/tests/forward-inherit-struct-with-fields.rs deleted file mode 100644 index e377b3ad..00000000 --- a/libbindgen/tests/expectations/tests/forward-inherit-struct-with-fields.rs +++ /dev/null @@ -1,17 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Rooted<T> { - pub _base: js_RootedBase<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct js_RootedBase<T> { - pub foo: *mut T, - pub next: *mut Rooted<T>, -} diff --git a/libbindgen/tests/expectations/tests/forward-inherit-struct.rs b/libbindgen/tests/expectations/tests/forward-inherit-struct.rs deleted file mode 100644 index 5de70fa9..00000000 --- a/libbindgen/tests/expectations/tests/forward-inherit-struct.rs +++ /dev/null @@ -1,18 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Rooted<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct js_RootedBase<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} diff --git a/libbindgen/tests/expectations/tests/forward_declared_struct.rs b/libbindgen/tests/expectations/tests/forward_declared_struct.rs deleted file mode 100644 index 5c2764e1..00000000 --- a/libbindgen/tests/expectations/tests/forward_declared_struct.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct a { - pub b: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_a() { - assert_eq!(::std::mem::size_of::<a>() , 4usize); - assert_eq!(::std::mem::align_of::<a>() , 4usize); -} -impl Clone for a { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct c { - pub d: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_c() { - assert_eq!(::std::mem::size_of::<c>() , 4usize); - assert_eq!(::std::mem::align_of::<c>() , 4usize); -} -impl Clone for c { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/func_proto.rs b/libbindgen/tests/expectations/tests/func_proto.rs deleted file mode 100644 index e7ac7504..00000000 --- a/libbindgen/tests/expectations/tests/func_proto.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type foo = - ::std::option::Option<unsafe extern "C" fn(bar: ::std::os::raw::c_int) - -> ::std::os::raw::c_int>; diff --git a/libbindgen/tests/expectations/tests/func_ptr.rs b/libbindgen/tests/expectations/tests/func_ptr.rs deleted file mode 100644 index 87ec3e3d..00000000 --- a/libbindgen/tests/expectations/tests/func_ptr.rs +++ /dev/null @@ -1,15 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - #[link_name = "foo"] - pub static mut foo: - ::std::option::Option<unsafe extern "C" fn(x: - ::std::os::raw::c_int, - y: - ::std::os::raw::c_int) - -> ::std::os::raw::c_int>; -} diff --git a/libbindgen/tests/expectations/tests/func_ptr_in_struct.rs b/libbindgen/tests/expectations/tests/func_ptr_in_struct.rs deleted file mode 100644 index dcae771b..00000000 --- a/libbindgen/tests/expectations/tests/func_ptr_in_struct.rs +++ /dev/null @@ -1,25 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum baz { } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Foo { - pub bar: ::std::option::Option<unsafe extern "C" fn(x: - ::std::os::raw::c_int, - y: - ::std::os::raw::c_int) - -> baz>, -} -#[test] -fn bindgen_test_layout_Foo() { - assert_eq!(::std::mem::size_of::<Foo>() , 8usize); - assert_eq!(::std::mem::align_of::<Foo>() , 8usize); -} -impl Clone for Foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/func_with_array_arg.rs b/libbindgen/tests/expectations/tests/func_with_array_arg.rs deleted file mode 100644 index 1528e0ba..00000000 --- a/libbindgen/tests/expectations/tests/func_with_array_arg.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - pub fn f(x: *mut ::std::os::raw::c_int); -} diff --git a/libbindgen/tests/expectations/tests/func_with_func_ptr_arg.rs b/libbindgen/tests/expectations/tests/func_with_func_ptr_arg.rs deleted file mode 100644 index 4ac25286..00000000 --- a/libbindgen/tests/expectations/tests/func_with_func_ptr_arg.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - pub fn foo(bar: ::std::option::Option<unsafe extern "C" fn()>); -} diff --git a/libbindgen/tests/expectations/tests/in_class_typedef.rs b/libbindgen/tests/expectations/tests/in_class_typedef.rs deleted file mode 100644 index 4e95ca8c..00000000 --- a/libbindgen/tests/expectations/tests/in_class_typedef.rs +++ /dev/null @@ -1,21 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Foo<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -pub type Foo_elem_type<T> = T; -pub type Foo_ptr_type<T> = *mut T; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Foo_Bar<T> { - pub x: ::std::os::raw::c_int, - pub y: ::std::os::raw::c_int, - pub _phantom_0: ::std::marker::PhantomData<T>, -} diff --git a/libbindgen/tests/expectations/tests/inherit-namespaced.rs b/libbindgen/tests/expectations/tests/inherit-namespaced.rs deleted file mode 100644 index c0d2e5a6..00000000 --- a/libbindgen/tests/expectations/tests/inherit-namespaced.rs +++ /dev/null @@ -1,18 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct js_RootedBase<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Rooted<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} diff --git a/libbindgen/tests/expectations/tests/inherit_named.rs b/libbindgen/tests/expectations/tests/inherit_named.rs deleted file mode 100644 index 8081c649..00000000 --- a/libbindgen/tests/expectations/tests/inherit_named.rs +++ /dev/null @@ -1,17 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Wohoo<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Weeee<T> { - pub _base: T, -} diff --git a/libbindgen/tests/expectations/tests/inherit_typedef.rs b/libbindgen/tests/expectations/tests/inherit_typedef.rs deleted file mode 100644 index 2b974223..00000000 --- a/libbindgen/tests/expectations/tests/inherit_typedef.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Foo { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Foo() { - assert_eq!(::std::mem::size_of::<Foo>() , 1usize); - assert_eq!(::std::mem::align_of::<Foo>() , 1usize); -} -impl Clone for Foo { - fn clone(&self) -> Self { *self } -} -pub use self::Foo as TypedefedFoo; -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Bar { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 1usize); - assert_eq!(::std::mem::align_of::<Bar>() , 1usize); -} -impl Clone for Bar { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/inline-function.rs b/libbindgen/tests/expectations/tests/inline-function.rs deleted file mode 100644 index b4b7b2bc..00000000 --- a/libbindgen/tests/expectations/tests/inline-function.rs +++ /dev/null @@ -1,7 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - - diff --git a/libbindgen/tests/expectations/tests/inline_namespace.rs b/libbindgen/tests/expectations/tests/inline_namespace.rs deleted file mode 100644 index 5f6776b7..00000000 --- a/libbindgen/tests/expectations/tests/inline_namespace.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - pub mod foo { - #[allow(unused_imports)] - use self::super::super::root; - pub type Ty = ::std::os::raw::c_int; - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Bar { - pub baz: root::foo::Ty, - } - #[test] - fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 4usize); - assert_eq!(::std::mem::align_of::<Bar>() , 4usize); - } - impl Clone for Bar { - fn clone(&self) -> Self { *self } - } -} diff --git a/libbindgen/tests/expectations/tests/inline_namespace_conservative.rs b/libbindgen/tests/expectations/tests/inline_namespace_conservative.rs deleted file mode 100644 index d759a882..00000000 --- a/libbindgen/tests/expectations/tests/inline_namespace_conservative.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - pub mod foo { - #[allow(unused_imports)] - use self::super::super::root; - pub mod bar { - #[allow(unused_imports)] - use self::super::super::super::root; - pub type Ty = ::std::os::raw::c_int; - } - pub type Ty = ::std::os::raw::c_longlong; - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Bar { - pub baz: root::foo::bar::Ty, - } - #[test] - fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 4usize); - assert_eq!(::std::mem::align_of::<Bar>() , 4usize); - } - impl Clone for Bar { - fn clone(&self) -> Self { *self } - } -} diff --git a/libbindgen/tests/expectations/tests/inline_namespace_whitelist.rs b/libbindgen/tests/expectations/tests/inline_namespace_whitelist.rs deleted file mode 100644 index 9b8f87a5..00000000 --- a/libbindgen/tests/expectations/tests/inline_namespace_whitelist.rs +++ /dev/null @@ -1,15 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - pub mod std { - #[allow(unused_imports)] - use self::super::super::root; - pub type string = *const ::std::os::raw::c_char; - } -} diff --git a/libbindgen/tests/expectations/tests/inner_const.rs b/libbindgen/tests/expectations/tests/inner_const.rs deleted file mode 100644 index 666b8ce2..00000000 --- a/libbindgen/tests/expectations/tests/inner_const.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Foo { - pub bar: ::std::os::raw::c_int, -} -extern "C" { - #[link_name = "_ZN3Foo3BOOE"] - pub static mut Foo_BOO: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "_ZN3Foo8whateverE"] - pub static mut Foo_whatever: Foo; -} -#[test] -fn bindgen_test_layout_Foo() { - assert_eq!(::std::mem::size_of::<Foo>() , 4usize); - assert_eq!(::std::mem::align_of::<Foo>() , 4usize); -} -impl Clone for Foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/inner_template_self.rs b/libbindgen/tests/expectations/tests/inner_template_self.rs deleted file mode 100644 index b965b92d..00000000 --- a/libbindgen/tests/expectations/tests/inner_template_self.rs +++ /dev/null @@ -1,25 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct LinkedList<T> { - pub next: *mut LinkedList<T>, - pub prev: *mut LinkedList<T>, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct InstantiateIt { - pub m_list: LinkedList<::std::os::raw::c_int>, -} -#[test] -fn bindgen_test_layout_InstantiateIt() { - assert_eq!(::std::mem::size_of::<InstantiateIt>() , 16usize); - assert_eq!(::std::mem::align_of::<InstantiateIt>() , 8usize); -} -impl Clone for InstantiateIt { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/int128_t.rs b/libbindgen/tests/expectations/tests/int128_t.rs deleted file mode 100644 index b4b7b2bc..00000000 --- a/libbindgen/tests/expectations/tests/int128_t.rs +++ /dev/null @@ -1,7 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - - diff --git a/libbindgen/tests/expectations/tests/issue-358.rs b/libbindgen/tests/expectations/tests/issue-358.rs deleted file mode 100644 index 1b933d34..00000000 --- a/libbindgen/tests/expectations/tests/issue-358.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JS_PersistentRooted<c> { - pub _base: a, - pub _phantom_0: ::std::marker::PhantomData<c>, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct a { - pub b: *mut a, -} -impl Clone for a { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/issue-372.rs b/libbindgen/tests/expectations/tests/issue-372.rs deleted file mode 100644 index c6d9209e..00000000 --- a/libbindgen/tests/expectations/tests/issue-372.rs +++ /dev/null @@ -1,63 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct d { - pub m: root::i, - } - #[test] - fn bindgen_test_layout_d() { - assert_eq!(::std::mem::size_of::<d>() , 24usize); - assert_eq!(::std::mem::align_of::<d>() , 8usize); - } - impl Clone for d { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct i { - pub j: *mut root::i, - pub k: *mut root::i, - pub l: bool, - } - #[test] - fn bindgen_test_layout_i() { - assert_eq!(::std::mem::size_of::<i>() , 24usize); - assert_eq!(::std::mem::align_of::<i>() , 8usize); - } - impl Clone for i { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum n { - o = 0, - p = 1, - q = 2, - r = 3, - s = 4, - t = 5, - b = 6, - ae = 7, - e = 8, - ag = 9, - ah = 10, - ai = 11, - } - #[repr(C)] - pub struct F { - pub w: [u64; 33usize], - } - #[test] - fn bindgen_test_layout_F() { - assert_eq!(::std::mem::size_of::<F>() , 264usize); - assert_eq!(::std::mem::align_of::<F>() , 8usize); - } -} diff --git a/libbindgen/tests/expectations/tests/issue_311.rs b/libbindgen/tests/expectations/tests/issue_311.rs deleted file mode 100644 index f01a9d93..00000000 --- a/libbindgen/tests/expectations/tests/issue_311.rs +++ /dev/null @@ -1,38 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct jsval_layout { - pub __bindgen_anon_1: root::jsval_layout__bindgen_ty_1, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct jsval_layout__bindgen_ty_1 { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_jsval_layout__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<jsval_layout__bindgen_ty_1>() , - 1usize); - assert_eq!(::std::mem::align_of::<jsval_layout__bindgen_ty_1>() , - 1usize); - } - impl Clone for jsval_layout__bindgen_ty_1 { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_jsval_layout() { - assert_eq!(::std::mem::size_of::<jsval_layout>() , 1usize); - assert_eq!(::std::mem::align_of::<jsval_layout>() , 1usize); - } - impl Clone for jsval_layout { - fn clone(&self) -> Self { *self } - } -} diff --git a/libbindgen/tests/expectations/tests/issue_315.rs b/libbindgen/tests/expectations/tests/issue_315.rs deleted file mode 100644 index a5ab63fc..00000000 --- a/libbindgen/tests/expectations/tests/issue_315.rs +++ /dev/null @@ -1,8 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -/// <div rustbindgen replaces="c"></div> -pub type c<a> = a; diff --git a/libbindgen/tests/expectations/tests/jsval_layout_opaque.rs b/libbindgen/tests/expectations/tests/jsval_layout_opaque.rs deleted file mode 100644 index 530fdb22..00000000 --- a/libbindgen/tests/expectations/tests/jsval_layout_opaque.rs +++ /dev/null @@ -1,200 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -pub const JSVAL_TAG_SHIFT: ::std::os::raw::c_uint = 47; -pub const JSVAL_PAYLOAD_MASK: ::std::os::raw::c_ulonglong = 140737488355327; -pub const JSVAL_TAG_MASK: ::std::os::raw::c_longlong = -140737488355328; -#[repr(u8)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum JSValueType { - JSVAL_TYPE_DOUBLE = 0, - JSVAL_TYPE_INT32 = 1, - JSVAL_TYPE_UNDEFINED = 2, - JSVAL_TYPE_BOOLEAN = 3, - JSVAL_TYPE_MAGIC = 4, - JSVAL_TYPE_STRING = 5, - JSVAL_TYPE_SYMBOL = 6, - JSVAL_TYPE_NULL = 7, - JSVAL_TYPE_OBJECT = 8, - JSVAL_TYPE_UNKNOWN = 32, - JSVAL_TYPE_MISSING = 33, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum JSValueTag { - JSVAL_TAG_MAX_DOUBLE = 131056, - JSVAL_TAG_INT32 = 131057, - JSVAL_TAG_UNDEFINED = 131058, - JSVAL_TAG_STRING = 131061, - JSVAL_TAG_SYMBOL = 131062, - JSVAL_TAG_BOOLEAN = 131059, - JSVAL_TAG_MAGIC = 131060, - JSVAL_TAG_NULL = 131063, - JSVAL_TAG_OBJECT = 131064, -} -#[repr(u64)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum JSValueShiftedTag { - JSVAL_SHIFTED_TAG_MAX_DOUBLE = 18444492278190833663, - JSVAL_SHIFTED_TAG_INT32 = 18444633011384221696, - JSVAL_SHIFTED_TAG_UNDEFINED = 18444773748872577024, - JSVAL_SHIFTED_TAG_STRING = 18445195961337643008, - JSVAL_SHIFTED_TAG_SYMBOL = 18445336698825998336, - JSVAL_SHIFTED_TAG_BOOLEAN = 18444914486360932352, - JSVAL_SHIFTED_TAG_MAGIC = 18445055223849287680, - JSVAL_SHIFTED_TAG_NULL = 18445477436314353664, - JSVAL_SHIFTED_TAG_OBJECT = 18445618173802708992, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum JSWhyMagic { - JS_ELEMENTS_HOLE = 0, - JS_NO_ITER_VALUE = 1, - JS_GENERATOR_CLOSING = 2, - JS_NO_CONSTANT = 3, - JS_THIS_POISON = 4, - JS_ARG_POISON = 5, - JS_SERIALIZE_NO_NODE = 6, - JS_LAZY_ARGUMENTS = 7, - JS_OPTIMIZED_ARGUMENTS = 8, - JS_IS_CONSTRUCTING = 9, - JS_OVERWRITTEN_CALLEE = 10, - JS_BLOCK_NEEDS_CLONE = 11, - JS_HASH_KEY_EMPTY = 12, - JS_ION_ERROR = 13, - JS_ION_BAILOUT = 14, - JS_OPTIMIZED_OUT = 15, - JS_UNINITIALIZED_LEXICAL = 16, - JS_GENERIC_MAGIC = 17, - JS_WHY_MAGIC_COUNT = 18, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct jsval_layout { - pub asBits: __BindgenUnionField<u64>, - pub debugView: __BindgenUnionField<jsval_layout__bindgen_ty_1>, - pub s: __BindgenUnionField<jsval_layout__bindgen_ty_2>, - pub asDouble: __BindgenUnionField<f64>, - pub asPtr: __BindgenUnionField<*mut ::std::os::raw::c_void>, - pub asWord: __BindgenUnionField<usize>, - pub asUIntPtr: __BindgenUnionField<usize>, - pub bindgen_union_field: u64, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct jsval_layout__bindgen_ty_1 { - pub _bitfield_1: u64, -} -#[test] -fn bindgen_test_layout_jsval_layout__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<jsval_layout__bindgen_ty_1>() , 8usize); - assert_eq!(::std::mem::align_of::<jsval_layout__bindgen_ty_1>() , 8usize); -} -impl Clone for jsval_layout__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -impl jsval_layout__bindgen_ty_1 { - #[inline] - pub fn payload47(&self) -> u64 { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & - (140737488355327usize as u64)) >> - 0u32) as u64) - } - } - #[inline] - pub fn set_payload47(&mut self, val: u64) { - self._bitfield_1 &= !(140737488355327usize as u64); - self._bitfield_1 |= - ((val as u64 as u64) << 0u32) & (140737488355327usize as u64); - } - #[inline] - pub fn tag(&self) -> JSValueTag { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & - (18446603336221196288usize as u64)) >> - 47u32) as u32) - } - } - #[inline] - pub fn set_tag(&mut self, val: JSValueTag) { - self._bitfield_1 &= !(18446603336221196288usize as u64); - self._bitfield_1 |= - ((val as u32 as u64) << 47u32) & - (18446603336221196288usize as u64); - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct jsval_layout__bindgen_ty_2 { - pub payload: jsval_layout__bindgen_ty_2__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct jsval_layout__bindgen_ty_2__bindgen_ty_1 { - pub i32: __BindgenUnionField<i32>, - pub u32: __BindgenUnionField<u32>, - pub why: __BindgenUnionField<JSWhyMagic>, - pub bindgen_union_field: u32, -} -#[test] -fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<jsval_layout__bindgen_ty_2__bindgen_ty_1>() - , 4usize); - assert_eq!(::std::mem::align_of::<jsval_layout__bindgen_ty_2__bindgen_ty_1>() - , 4usize); -} -impl Clone for jsval_layout__bindgen_ty_2__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_jsval_layout__bindgen_ty_2() { - assert_eq!(::std::mem::size_of::<jsval_layout__bindgen_ty_2>() , 4usize); - assert_eq!(::std::mem::align_of::<jsval_layout__bindgen_ty_2>() , 4usize); -} -impl Clone for jsval_layout__bindgen_ty_2 { - fn clone(&self) -> Self { *self } -} -impl Clone for jsval_layout { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Value { - pub data: jsval_layout, -} -#[test] -fn bindgen_test_layout_Value() { - assert_eq!(::std::mem::size_of::<Value>() , 8usize); - assert_eq!(::std::mem::align_of::<Value>() , 8usize); -} -impl Clone for Value { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/keywords.rs b/libbindgen/tests/expectations/tests/keywords.rs deleted file mode 100644 index 5b75389e..00000000 --- a/libbindgen/tests/expectations/tests/keywords.rs +++ /dev/null @@ -1,202 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - #[link_name = "u8"] - pub static mut u8: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "u16"] - pub static mut u16: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "u32"] - pub static mut u32: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "u64"] - pub static mut u64: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "i8"] - pub static mut i8: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "i16"] - pub static mut i16: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "i32"] - pub static mut i32: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "i64"] - pub static mut i64: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "f32"] - pub static mut f32: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "f64"] - pub static mut f64: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "usize"] - pub static mut usize: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "isize"] - pub static mut isize: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "as"] - pub static mut as_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "box"] - pub static mut box_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "crate"] - pub static mut crate_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "false"] - pub static mut false_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "fn"] - pub static mut fn_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "impl"] - pub static mut impl_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "in"] - pub static mut in_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "let"] - pub static mut let_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "loop"] - pub static mut loop_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "match"] - pub static mut match_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "mod"] - pub static mut mod_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "move"] - pub static mut move_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "mut"] - pub static mut mut_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "pub"] - pub static mut pub_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "ref"] - pub static mut ref_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "self"] - pub static mut self_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "Self"] - pub static mut Self_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "super"] - pub static mut super_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "trait"] - pub static mut trait_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "true"] - pub static mut true_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "type"] - pub static mut type_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "unsafe"] - pub static mut unsafe_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "use"] - pub static mut use_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "where"] - pub static mut where_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "abstract"] - pub static mut abstract_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "alignof"] - pub static mut alignof_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "become"] - pub static mut become_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "final"] - pub static mut final_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "macro"] - pub static mut macro_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "offsetof"] - pub static mut offsetof_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "override"] - pub static mut override_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "priv"] - pub static mut priv_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "proc"] - pub static mut proc_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "pure"] - pub static mut pure_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "unsized"] - pub static mut unsized_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "virtual"] - pub static mut virtual_: ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "yield"] - pub static mut yield_: ::std::os::raw::c_int; -} diff --git a/libbindgen/tests/expectations/tests/macro-expr-basic.rs b/libbindgen/tests/expectations/tests/macro-expr-basic.rs deleted file mode 100644 index 355294e7..00000000 --- a/libbindgen/tests/expectations/tests/macro-expr-basic.rs +++ /dev/null @@ -1,15 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const FOO: ::std::os::raw::c_uint = 1; -pub const BAR: ::std::os::raw::c_uint = 4; -pub const BAZ: ::std::os::raw::c_uint = 5; -pub const MIN: ::std::os::raw::c_longlong = -9223372036854775808; -pub const BARR: ::std::os::raw::c_uint = 1; -pub const BAZZ: ::std::os::raw::c_uint = 7; -pub const I_RAN_OUT_OF_DUMB_NAMES: ::std::os::raw::c_uint = 7; -pub const HAZ_A_COMMENT: ::std::os::raw::c_uint = 1; -pub const HAZ_A_COMMENT_INSIDE: ::std::os::raw::c_uint = 2; diff --git a/libbindgen/tests/expectations/tests/macro-redef.rs b/libbindgen/tests/expectations/tests/macro-redef.rs deleted file mode 100644 index 881a44ae..00000000 --- a/libbindgen/tests/expectations/tests/macro-redef.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const FOO: ::std::os::raw::c_uint = 4; -pub const BAR: ::std::os::raw::c_uint = 5; -pub const BAZ: ::std::os::raw::c_uint = 6; diff --git a/libbindgen/tests/expectations/tests/macro_const.rs b/libbindgen/tests/expectations/tests/macro_const.rs deleted file mode 100644 index 9e7eb420..00000000 --- a/libbindgen/tests/expectations/tests/macro_const.rs +++ /dev/null @@ -1,12 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const foo: &'static [u8; 4usize] = b"bar\x00"; -pub const CHAR: u8 = b'b'; -pub const CHARR: u8 = b'\x00'; -pub const FLOAT: f32 = 5.09; -pub const FLOAT_EXPR: f32 = 0.005; -pub const INVALID_UTF8: [u8; 5usize] = [240, 40, 140, 40, 0]; diff --git a/libbindgen/tests/expectations/tests/maddness-is-avoidable.rs b/libbindgen/tests/expectations/tests/maddness-is-avoidable.rs deleted file mode 100644 index d31345ba..00000000 --- a/libbindgen/tests/expectations/tests/maddness-is-avoidable.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RefPtr<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RefPtr_Proxy<T, R, Args> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, - pub _phantom_1: ::std::marker::PhantomData<R>, - pub _phantom_2: ::std::marker::PhantomData<Args>, -} diff --git a/libbindgen/tests/expectations/tests/method-mangling.rs b/libbindgen/tests/expectations/tests/method-mangling.rs deleted file mode 100644 index 3b5107a8..00000000 --- a/libbindgen/tests/expectations/tests/method-mangling.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Foo { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Foo() { - assert_eq!(::std::mem::size_of::<Foo>() , 1usize); - assert_eq!(::std::mem::align_of::<Foo>() , 1usize); -} -extern "C" { - #[link_name = "_ZN3Foo4typeEv"] - pub fn Foo_type(this: *mut Foo) -> ::std::os::raw::c_int; -} -impl Clone for Foo { - fn clone(&self) -> Self { *self } -} -impl Foo { - #[inline] - pub unsafe fn type_(&mut self) -> ::std::os::raw::c_int { - Foo_type(&mut *self) - } -} diff --git a/libbindgen/tests/expectations/tests/module-whitelisted.rs b/libbindgen/tests/expectations/tests/module-whitelisted.rs deleted file mode 100644 index 6f88c54b..00000000 --- a/libbindgen/tests/expectations/tests/module-whitelisted.rs +++ /dev/null @@ -1,23 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Test { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_Test() { - assert_eq!(::std::mem::size_of::<Test>() , 1usize); - assert_eq!(::std::mem::align_of::<Test>() , 1usize); - } - impl Clone for Test { - fn clone(&self) -> Self { *self } - } -} diff --git a/libbindgen/tests/expectations/tests/msvc-no-usr.rs b/libbindgen/tests/expectations/tests/msvc-no-usr.rs deleted file mode 100644 index 8cab8cdc..00000000 --- a/libbindgen/tests/expectations/tests/msvc-no-usr.rs +++ /dev/null @@ -1,19 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct A { - pub foo: usize, -} -#[test] -fn bindgen_test_layout_A() { - assert_eq!(::std::mem::size_of::<A>() , 8usize); - assert_eq!(::std::mem::align_of::<A>() , 8usize); -} -impl Clone for A { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs b/libbindgen/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs deleted file mode 100644 index 5e9cf522..00000000 --- a/libbindgen/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs +++ /dev/null @@ -1,45 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Foo { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Foo() { - assert_eq!(::std::mem::size_of::<Foo>() , 1usize); - assert_eq!(::std::mem::align_of::<Foo>() , 1usize); -} -impl Clone for Foo { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Bar { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 1usize); - assert_eq!(::std::mem::align_of::<Bar>() , 1usize); -} -impl Clone for Bar { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Baz { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Baz() { - assert_eq!(::std::mem::size_of::<Baz>() , 1usize); - assert_eq!(::std::mem::align_of::<Baz>() , 1usize); -} -impl Clone for Baz { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/mutable.rs b/libbindgen/tests/expectations/tests/mutable.rs deleted file mode 100644 index 0d0d6ea3..00000000 --- a/libbindgen/tests/expectations/tests/mutable.rs +++ /dev/null @@ -1,42 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C { - pub m_member: ::std::os::raw::c_int, - pub m_other: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_C() { - assert_eq!(::std::mem::size_of::<C>() , 8usize); - assert_eq!(::std::mem::align_of::<C>() , 4usize); -} -impl Clone for C { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug)] -pub struct NonCopiable { - pub m_member: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_NonCopiable() { - assert_eq!(::std::mem::size_of::<NonCopiable>() , 4usize); - assert_eq!(::std::mem::align_of::<NonCopiable>() , 4usize); -} -#[repr(C)] -#[derive(Debug)] -pub struct NonCopiableWithNonCopiableMutableMember { - pub m_member: NonCopiable, -} -#[test] -fn bindgen_test_layout_NonCopiableWithNonCopiableMutableMember() { - assert_eq!(::std::mem::size_of::<NonCopiableWithNonCopiableMutableMember>() - , 4usize); - assert_eq!(::std::mem::align_of::<NonCopiableWithNonCopiableMutableMember>() - , 4usize); -} diff --git a/libbindgen/tests/expectations/tests/namespace.rs b/libbindgen/tests/expectations/tests/namespace.rs deleted file mode 100644 index ece4e341..00000000 --- a/libbindgen/tests/expectations/tests/namespace.rs +++ /dev/null @@ -1,87 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - extern "C" { - #[link_name = "_Z9top_levelv"] - pub fn top_level(); - } - pub mod whatever { - #[allow(unused_imports)] - use self::super::super::root; - pub type whatever_int_t = ::std::os::raw::c_int; - extern "C" { - #[link_name = "_ZN8whatever11in_whateverEv"] - pub fn in_whatever(); - } - } - pub mod _bindgen_mod_id_13 { - #[allow(unused_imports)] - use self::super::super::root; - extern "C" { - #[link_name = "_ZN12_GLOBAL__N_13fooEv"] - pub fn foo(); - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct A { - pub b: root::whatever::whatever_int_t, - } - #[test] - fn bindgen_test_layout_A() { - assert_eq!(::std::mem::size_of::<A>() , 4usize); - assert_eq!(::std::mem::align_of::<A>() , 4usize); - } - extern "C" { - #[link_name = "_ZN12_GLOBAL__N_11A20lets_hope_this_worksEv"] - pub fn A_lets_hope_this_works(this: - *mut root::_bindgen_mod_id_13::A) - -> ::std::os::raw::c_int; - } - impl Clone for A { - fn clone(&self) -> Self { *self } - } - impl A { - #[inline] - pub unsafe fn lets_hope_this_works(&mut self) - -> ::std::os::raw::c_int { - A_lets_hope_this_works(&mut *self) - } - } - } - #[repr(C)] - #[derive(Debug)] - pub struct C<T> { - pub _base: root::_bindgen_mod_id_13::A, - pub m_c: T, - pub m_c_ptr: *mut T, - pub m_c_arr: [T; 10usize], - } - pub mod w { - #[allow(unused_imports)] - use self::super::super::root; - pub type whatever_int_t = ::std::os::raw::c_uint; - #[repr(C)] - #[derive(Debug)] - pub struct D<T> { - pub m_c: root::C<T>, - } - extern "C" { - #[link_name = "_ZN1w3hehEv"] - pub fn heh() -> root::w::whatever_int_t; - } - extern "C" { - #[link_name = "_ZN1w3fooEv"] - pub fn foo() -> root::C<::std::os::raw::c_int>; - } - extern "C" { - #[link_name = "_ZN1w4barrEv"] - pub fn barr() -> root::C<f32>; - } - } -} diff --git a/libbindgen/tests/expectations/tests/nested.rs b/libbindgen/tests/expectations/tests/nested.rs deleted file mode 100644 index fdd435aa..00000000 --- a/libbindgen/tests/expectations/tests/nested.rs +++ /dev/null @@ -1,59 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Calc { - pub w: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Calc() { - assert_eq!(::std::mem::size_of::<Calc>() , 4usize); - assert_eq!(::std::mem::align_of::<Calc>() , 4usize); -} -impl Clone for Calc { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Test { - pub _address: u8, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Test_Size { - pub mWidth: Test_Size_Dimension, - pub mHeight: Test_Size_Dimension, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Test_Size_Dimension { - pub _base: Calc, -} -#[test] -fn bindgen_test_layout_Test_Size_Dimension() { - assert_eq!(::std::mem::size_of::<Test_Size_Dimension>() , 4usize); - assert_eq!(::std::mem::align_of::<Test_Size_Dimension>() , 4usize); -} -impl Clone for Test_Size_Dimension { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_Test_Size() { - assert_eq!(::std::mem::size_of::<Test_Size>() , 8usize); - assert_eq!(::std::mem::align_of::<Test_Size>() , 4usize); -} -impl Clone for Test_Size { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_Test() { - assert_eq!(::std::mem::size_of::<Test>() , 1usize); - assert_eq!(::std::mem::align_of::<Test>() , 1usize); -} -impl Clone for Test { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/nested_vtable.rs b/libbindgen/tests/expectations/tests/nested_vtable.rs deleted file mode 100644 index d74ad55f..00000000 --- a/libbindgen/tests/expectations/tests/nested_vtable.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct nsISupports__bindgen_vtable { -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct nsISupports { - pub vtable_: *const nsISupports__bindgen_vtable, -} -#[test] -fn bindgen_test_layout_nsISupports() { - assert_eq!(::std::mem::size_of::<nsISupports>() , 8usize); - assert_eq!(::std::mem::align_of::<nsISupports>() , 8usize); -} -impl Clone for nsISupports { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct nsIRunnable { - pub _base: nsISupports, -} -#[test] -fn bindgen_test_layout_nsIRunnable() { - assert_eq!(::std::mem::size_of::<nsIRunnable>() , 8usize); - assert_eq!(::std::mem::align_of::<nsIRunnable>() , 8usize); -} -impl Clone for nsIRunnable { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Runnable { - pub _base: nsIRunnable, -} -#[test] -fn bindgen_test_layout_Runnable() { - assert_eq!(::std::mem::size_of::<Runnable>() , 8usize); - assert_eq!(::std::mem::align_of::<Runnable>() , 8usize); -} -impl Clone for Runnable { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/nested_within_namespace.rs b/libbindgen/tests/expectations/tests/nested_within_namespace.rs deleted file mode 100644 index 0c9c31ef..00000000 --- a/libbindgen/tests/expectations/tests/nested_within_namespace.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - pub mod foo { - #[allow(unused_imports)] - use self::super::super::root; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Bar { - pub foo: ::std::os::raw::c_int, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Bar_Baz { - pub foo: ::std::os::raw::c_int, - } - #[test] - fn bindgen_test_layout_Bar_Baz() { - assert_eq!(::std::mem::size_of::<Bar_Baz>() , 4usize); - assert_eq!(::std::mem::align_of::<Bar_Baz>() , 4usize); - } - impl Clone for Bar_Baz { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 4usize); - assert_eq!(::std::mem::align_of::<Bar>() , 4usize); - } - impl Clone for Bar { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Baz { - pub baz: ::std::os::raw::c_int, - } - #[test] - fn bindgen_test_layout_Baz() { - assert_eq!(::std::mem::size_of::<Baz>() , 4usize); - assert_eq!(::std::mem::align_of::<Baz>() , 4usize); - } - impl Clone for Baz { - fn clone(&self) -> Self { *self } - } - } -} diff --git a/libbindgen/tests/expectations/tests/no-std.rs b/libbindgen/tests/expectations/tests/no-std.rs deleted file mode 100644 index f50a889d..00000000 --- a/libbindgen/tests/expectations/tests/no-std.rs +++ /dev/null @@ -1,23 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - -#![no_std] -mod libc { pub type c_int = i32; pub enum c_void {} } - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub a: libc::c_int, - pub b: libc::c_int, - pub bar: *mut libc::c_void, -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::core::mem::size_of::<foo>() , 16usize); - assert_eq!(::core::mem::align_of::<foo>() , 8usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/no_copy.rs b/libbindgen/tests/expectations/tests/no_copy.rs deleted file mode 100644 index 53ab9677..00000000 --- a/libbindgen/tests/expectations/tests/no_copy.rs +++ /dev/null @@ -1,13 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -/** <div rustbindgen nocopy></div> */ -#[repr(C)] -#[derive(Debug)] -pub struct CopiableButWait<T> { - pub whatever: ::std::os::raw::c_int, - pub _phantom_0: ::std::marker::PhantomData<T>, -} diff --git a/libbindgen/tests/expectations/tests/nsStyleAutoArray.rs b/libbindgen/tests/expectations/tests/nsStyleAutoArray.rs deleted file mode 100644 index c150ec46..00000000 --- a/libbindgen/tests/expectations/tests/nsStyleAutoArray.rs +++ /dev/null @@ -1,22 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct nsTArray<T> { - pub mBuff: *mut T, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct nsStyleAutoArray<T> { - pub mFirstElement: T, - pub mOtherElements: nsTArray<T>, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum nsStyleAutoArray_WithSingleInitialElement { - WITH_SINGLE_INITIAL_ELEMENT = 0, -} diff --git a/libbindgen/tests/expectations/tests/only_bitfields.rs b/libbindgen/tests/expectations/tests/only_bitfields.rs deleted file mode 100644 index 68968826..00000000 --- a/libbindgen/tests/expectations/tests/only_bitfields.rs +++ /dev/null @@ -1,45 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C { - pub _bitfield_1: u8, -} -#[test] -fn bindgen_test_layout_C() { - assert_eq!(::std::mem::size_of::<C>() , 1usize); - assert_eq!(::std::mem::align_of::<C>() , 1usize); -} -impl Clone for C { - fn clone(&self) -> Self { *self } -} -impl C { - #[inline] - pub fn a(&self) -> bool { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & (1usize as u8)) >> - 0u32) as u8) - } - } - #[inline] - pub fn set_a(&mut self, val: bool) { - self._bitfield_1 &= !(1usize as u8); - self._bitfield_1 |= ((val as u8 as u8) << 0u32) & (1usize as u8); - } - #[inline] - pub fn b(&self) -> bool { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & (254usize as u8)) >> - 1u32) as u8) - } - } - #[inline] - pub fn set_b(&mut self, val: bool) { - self._bitfield_1 &= !(254usize as u8); - self._bitfield_1 |= ((val as u8 as u8) << 1u32) & (254usize as u8); - } -} diff --git a/libbindgen/tests/expectations/tests/opaque-tracing.rs b/libbindgen/tests/expectations/tests/opaque-tracing.rs deleted file mode 100644 index 7dcc4eef..00000000 --- a/libbindgen/tests/expectations/tests/opaque-tracing.rs +++ /dev/null @@ -1,23 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Container { - pub _bindgen_opaque_blob: [u32; 2usize], -} -#[test] -fn bindgen_test_layout_Container() { - assert_eq!(::std::mem::size_of::<Container>() , 8usize); - assert_eq!(::std::mem::align_of::<Container>() , 4usize); -} -impl Clone for Container { - fn clone(&self) -> Self { *self } -} -extern "C" { - #[link_name = "_Z3fooP9Container"] - pub fn foo(c: *mut Container); -} diff --git a/libbindgen/tests/expectations/tests/opaque_in_struct.rs b/libbindgen/tests/expectations/tests/opaque_in_struct.rs deleted file mode 100644 index c94caa1f..00000000 --- a/libbindgen/tests/expectations/tests/opaque_in_struct.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -/** <div rustbindgen opaque> */ -#[repr(C)] -#[derive(Debug, Copy)] -pub struct opaque { - pub _bindgen_opaque_blob: u32, -} -#[test] -fn bindgen_test_layout_opaque() { - assert_eq!(::std::mem::size_of::<opaque>() , 4usize); - assert_eq!(::std::mem::align_of::<opaque>() , 4usize); -} -impl Clone for opaque { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct container { - pub contained: opaque, -} -#[test] -fn bindgen_test_layout_container() { - assert_eq!(::std::mem::size_of::<container>() , 4usize); - assert_eq!(::std::mem::align_of::<container>() , 4usize); -} -impl Clone for container { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/opaque_pointer.rs b/libbindgen/tests/expectations/tests/opaque_pointer.rs deleted file mode 100644 index 118a1782..00000000 --- a/libbindgen/tests/expectations/tests/opaque_pointer.rs +++ /dev/null @@ -1,45 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -/** - * <div rustbindgen opaque></div> - */ -#[repr(C)] -#[derive(Debug, Copy)] -pub struct OtherOpaque { - pub _bindgen_opaque_blob: u32, -} -#[test] -fn bindgen_test_layout_OtherOpaque() { - assert_eq!(::std::mem::size_of::<OtherOpaque>() , 4usize); - assert_eq!(::std::mem::align_of::<OtherOpaque>() , 4usize); -} -impl Clone for OtherOpaque { - fn clone(&self) -> Self { *self } -} -/** - * <div rustbindgen opaque></div> - */ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Opaque<T> { - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct WithOpaquePtr { - pub whatever: *mut Opaque<::std::os::raw::c_int>, - pub other: u32, - pub t: OtherOpaque, -} -#[test] -fn bindgen_test_layout_WithOpaquePtr() { - assert_eq!(::std::mem::size_of::<WithOpaquePtr>() , 16usize); - assert_eq!(::std::mem::align_of::<WithOpaquePtr>() , 8usize); -} -impl Clone for WithOpaquePtr { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/opaque_typedef.rs b/libbindgen/tests/expectations/tests/opaque_typedef.rs deleted file mode 100644 index c45cbc6f..00000000 --- a/libbindgen/tests/expectations/tests/opaque_typedef.rs +++ /dev/null @@ -1,15 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RandomTemplate<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -/** <div rustbindgen opaque></div> */ -pub type ShouldBeOpaque = [u8; 0usize]; -pub type ShouldNotBeOpaque = RandomTemplate<f32>; diff --git a/libbindgen/tests/expectations/tests/overflowed_enum.rs b/libbindgen/tests/expectations/tests/overflowed_enum.rs deleted file mode 100644 index 9e1f8a7f..00000000 --- a/libbindgen/tests/expectations/tests/overflowed_enum.rs +++ /dev/null @@ -1,16 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Foo { - BAP_ARM = 9698489, - BAP_X86 = 11960045, - BAP_X86_64 = 3128633167, -} -#[repr(u16)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Bar { One = 1, Big = 2, } diff --git a/libbindgen/tests/expectations/tests/overloading.rs b/libbindgen/tests/expectations/tests/overloading.rs deleted file mode 100644 index 71002e23..00000000 --- a/libbindgen/tests/expectations/tests/overloading.rs +++ /dev/null @@ -1,23 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - #[link_name = "_Z8Evaluatec"] - pub fn Evaluate(r: ::std::os::raw::c_char) -> bool; -} -extern "C" { - #[link_name = "_Z8Evaluateii"] - pub fn Evaluate1(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) - -> bool; -} -extern "C" { - #[link_name = "_ZN3foo10MyFunctionEv"] - pub fn foo_MyFunction(); -} -extern "C" { - #[link_name = "_ZN3bar10MyFunctionEv"] - pub fn bar_MyFunction(); -} diff --git a/libbindgen/tests/expectations/tests/private.rs b/libbindgen/tests/expectations/tests/private.rs deleted file mode 100644 index c4ac37d1..00000000 --- a/libbindgen/tests/expectations/tests/private.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct HasPrivate { - pub mNotPrivate: ::std::os::raw::c_int, - /** <div rustbindgen private></div> */ - mIsPrivate: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_HasPrivate() { - assert_eq!(::std::mem::size_of::<HasPrivate>() , 8usize); - assert_eq!(::std::mem::align_of::<HasPrivate>() , 4usize); -} -impl Clone for HasPrivate { - fn clone(&self) -> Self { *self } -} -/** <div rustbindgen private></div> */ -#[repr(C)] -#[derive(Debug, Copy)] -pub struct VeryPrivate { - mIsPrivate: ::std::os::raw::c_int, - mIsAlsoPrivate: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_VeryPrivate() { - assert_eq!(::std::mem::size_of::<VeryPrivate>() , 8usize); - assert_eq!(::std::mem::align_of::<VeryPrivate>() , 4usize); -} -impl Clone for VeryPrivate { - fn clone(&self) -> Self { *self } -} -/** <div rustbindgen private></div> */ -#[repr(C)] -#[derive(Debug, Copy)] -pub struct ContradictPrivate { - /** <div rustbindgen private="false"></div> */ - pub mNotPrivate: ::std::os::raw::c_int, - mIsPrivate: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_ContradictPrivate() { - assert_eq!(::std::mem::size_of::<ContradictPrivate>() , 8usize); - assert_eq!(::std::mem::align_of::<ContradictPrivate>() , 4usize); -} -impl Clone for ContradictPrivate { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/public-dtor.rs b/libbindgen/tests/expectations/tests/public-dtor.rs deleted file mode 100644 index 851857ee..00000000 --- a/libbindgen/tests/expectations/tests/public-dtor.rs +++ /dev/null @@ -1,16 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug)] -pub struct cv_String { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_cv_String() { - assert_eq!(::std::mem::size_of::<cv_String>() , 1usize); - assert_eq!(::std::mem::align_of::<cv_String>() , 1usize); -} diff --git a/libbindgen/tests/expectations/tests/redeclaration.rs b/libbindgen/tests/expectations/tests/redeclaration.rs deleted file mode 100644 index 0d7e585c..00000000 --- a/libbindgen/tests/expectations/tests/redeclaration.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - pub fn foo(); -} diff --git a/libbindgen/tests/expectations/tests/ref_argument_array.rs b/libbindgen/tests/expectations/tests/ref_argument_array.rs deleted file mode 100644 index c88492d7..00000000 --- a/libbindgen/tests/expectations/tests/ref_argument_array.rs +++ /dev/null @@ -1,23 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const NSID_LENGTH: ::std::os::raw::c_uint = 10; -#[repr(C)] -pub struct nsID__bindgen_vtable { -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct nsID { - pub vtable_: *const nsID__bindgen_vtable, -} -#[test] -fn bindgen_test_layout_nsID() { - assert_eq!(::std::mem::size_of::<nsID>() , 8usize); - assert_eq!(::std::mem::align_of::<nsID>() , 8usize); -} -impl Clone for nsID { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/reparented_replacement.rs b/libbindgen/tests/expectations/tests/reparented_replacement.rs deleted file mode 100644 index e8ccc931..00000000 --- a/libbindgen/tests/expectations/tests/reparented_replacement.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - pub mod foo { - #[allow(unused_imports)] - use self::super::super::root; - /// <div rustbindgen replaces="foo::Bar"></div> - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Bar { - pub bazz: ::std::os::raw::c_int, - } - #[test] - fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 4usize); - assert_eq!(::std::mem::align_of::<Bar>() , 4usize); - } - impl Clone for Bar { - fn clone(&self) -> Self { *self } - } - } - pub use root::foo::Bar as ReferencesBar; -} diff --git a/libbindgen/tests/expectations/tests/replace_template_alias.rs b/libbindgen/tests/expectations/tests/replace_template_alias.rs deleted file mode 100644 index f922ac77..00000000 --- a/libbindgen/tests/expectations/tests/replace_template_alias.rs +++ /dev/null @@ -1,15 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -/// But the replacement type does use T! -/// -/// <div rustbindgen replaces="JS::detail::MaybeWrapped" /> -pub type JS_detail_MaybeWrapped<T> = T; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JS_Rooted<T> { - pub ptr: JS_detail_MaybeWrapped<T>, -} diff --git a/libbindgen/tests/expectations/tests/replace_use.rs b/libbindgen/tests/expectations/tests/replace_use.rs deleted file mode 100644 index f4fee442..00000000 --- a/libbindgen/tests/expectations/tests/replace_use.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -/** - * <div rustbindgen replaces="nsTArray"></div> - */ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct nsTArray<T> { - pub y: ::std::os::raw::c_uint, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Test { - pub a: nsTArray<::std::os::raw::c_long>, -} -#[test] -fn bindgen_test_layout_Test() { - assert_eq!(::std::mem::size_of::<Test>() , 4usize); - assert_eq!(::std::mem::align_of::<Test>() , 4usize); -} -impl Clone for Test { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/replaces_double.rs b/libbindgen/tests/expectations/tests/replaces_double.rs deleted file mode 100644 index 50dafd42..00000000 --- a/libbindgen/tests/expectations/tests/replaces_double.rs +++ /dev/null @@ -1,15 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Rooted<T> { - pub ptr: Rooted_MaybeWrapped<T>, -} -/** - * <div rustbindgen replaces="Rooted_MaybeWrapped"></div> - */ -pub type Rooted_MaybeWrapped<T> = T; diff --git a/libbindgen/tests/expectations/tests/resolved_type_def_function.rs b/libbindgen/tests/expectations/tests/resolved_type_def_function.rs deleted file mode 100644 index 83f07dd0..00000000 --- a/libbindgen/tests/expectations/tests/resolved_type_def_function.rs +++ /dev/null @@ -1,10 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type FuncType = ::std::option::Option<unsafe extern "C" fn()>; -extern "C" { - pub fn Func(); -} diff --git a/libbindgen/tests/expectations/tests/same_struct_name_in_different_namespaces.rs b/libbindgen/tests/expectations/tests/same_struct_name_in_different_namespaces.rs deleted file mode 100644 index 8e7c177b..00000000 --- a/libbindgen/tests/expectations/tests/same_struct_name_in_different_namespaces.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct JS_Zone { - pub _address: u8, -} -impl Clone for JS_Zone { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct JS_shadow_Zone { - pub x: ::std::os::raw::c_int, - pub y: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JS_shadow_Zone() { - assert_eq!(::std::mem::size_of::<JS_shadow_Zone>() , 8usize); - assert_eq!(::std::mem::align_of::<JS_shadow_Zone>() , 4usize); -} -impl Clone for JS_shadow_Zone { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/size_t_template.rs b/libbindgen/tests/expectations/tests/size_t_template.rs deleted file mode 100644 index 78351ecc..00000000 --- a/libbindgen/tests/expectations/tests/size_t_template.rs +++ /dev/null @@ -1,19 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C { - pub arr: [u32; 3usize], -} -#[test] -fn bindgen_test_layout_C() { - assert_eq!(::std::mem::size_of::<C>() , 12usize); - assert_eq!(::std::mem::align_of::<C>() , 4usize); -} -impl Clone for C { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/struct_containing_forward_declared_struct.rs b/libbindgen/tests/expectations/tests/struct_containing_forward_declared_struct.rs deleted file mode 100644 index 388cc595..00000000 --- a/libbindgen/tests/expectations/tests/struct_containing_forward_declared_struct.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct a { - pub val_a: *mut a_b, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct a_b { - pub val_b: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_a_b() { - assert_eq!(::std::mem::size_of::<a_b>() , 4usize); - assert_eq!(::std::mem::align_of::<a_b>() , 4usize); -} -impl Clone for a_b { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_a() { - assert_eq!(::std::mem::size_of::<a>() , 8usize); - assert_eq!(::std::mem::align_of::<a>() , 8usize); -} -impl Clone for a { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/struct_with_anon_struct.rs b/libbindgen/tests/expectations/tests/struct_with_anon_struct.rs deleted file mode 100644 index 1c49675d..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_anon_struct.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub bar: foo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub a: ::std::os::raw::c_int, - pub b: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 8usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/struct_with_anon_struct_array.rs b/libbindgen/tests/expectations/tests/struct_with_anon_struct_array.rs deleted file mode 100644 index 6e1c0315..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_anon_struct_array.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub bar: [foo__bindgen_ty_1; 2usize], - pub baz: [[[foo__bindgen_ty_2; 4usize]; 3usize]; 2usize], -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub a: ::std::os::raw::c_int, - pub b: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_2 { - pub a: ::std::os::raw::c_int, - pub b: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_2() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_2>() , 8usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_2>() , 4usize); -} -impl Clone for foo__bindgen_ty_2 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 208usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/struct_with_anon_struct_pointer.rs b/libbindgen/tests/expectations/tests/struct_with_anon_struct_pointer.rs deleted file mode 100644 index aa77d4b6..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_anon_struct_pointer.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub bar: *mut foo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub a: ::std::os::raw::c_int, - pub b: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 8usize); - assert_eq!(::std::mem::align_of::<foo>() , 8usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/struct_with_anon_union.rs b/libbindgen/tests/expectations/tests/struct_with_anon_union.rs deleted file mode 100644 index 0d2e937a..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_anon_union.rs +++ /dev/null @@ -1,58 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub bar: foo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub a: __BindgenUnionField<::std::os::raw::c_uint>, - pub b: __BindgenUnionField<::std::os::raw::c_ushort>, - pub bindgen_union_field: u32, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 4usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/struct_with_anon_unnamed_struct.rs b/libbindgen/tests/expectations/tests/struct_with_anon_unnamed_struct.rs deleted file mode 100644 index 1b77fccc..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_anon_unnamed_struct.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub __bindgen_anon_1: foo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub a: ::std::os::raw::c_uint, - pub b: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 8usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/struct_with_anon_unnamed_union.rs b/libbindgen/tests/expectations/tests/struct_with_anon_unnamed_union.rs deleted file mode 100644 index 2914eb41..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_anon_unnamed_union.rs +++ /dev/null @@ -1,58 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub __bindgen_anon_1: foo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub a: __BindgenUnionField<::std::os::raw::c_uint>, - pub b: __BindgenUnionField<::std::os::raw::c_ushort>, - pub bindgen_union_field: u32, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 4usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/struct_with_bitfields.rs b/libbindgen/tests/expectations/tests/struct_with_bitfields.rs deleted file mode 100644 index 3fb83a47..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_bitfields.rs +++ /dev/null @@ -1,122 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct bitfield { - pub _bitfield_1: u8, - pub e: ::std::os::raw::c_int, - pub _bitfield_2: u8, - pub _bitfield_3: u32, -} -#[test] -fn bindgen_test_layout_bitfield() { - assert_eq!(::std::mem::size_of::<bitfield>() , 16usize); - assert_eq!(::std::mem::align_of::<bitfield>() , 4usize); -} -impl Clone for bitfield { - fn clone(&self) -> Self { *self } -} -impl bitfield { - #[inline] - pub fn a(&self) -> ::std::os::raw::c_ushort { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & (1usize as u8)) >> - 0u32) as u16) - } - } - #[inline] - pub fn set_a(&mut self, val: ::std::os::raw::c_ushort) { - self._bitfield_1 &= !(1usize as u8); - self._bitfield_1 |= ((val as u16 as u8) << 0u32) & (1usize as u8); - } - #[inline] - pub fn b(&self) -> ::std::os::raw::c_ushort { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & (2usize as u8)) >> - 1u32) as u16) - } - } - #[inline] - pub fn set_b(&mut self, val: ::std::os::raw::c_ushort) { - self._bitfield_1 &= !(2usize as u8); - self._bitfield_1 |= ((val as u16 as u8) << 1u32) & (2usize as u8); - } - #[inline] - pub fn c(&self) -> ::std::os::raw::c_ushort { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & (4usize as u8)) >> - 2u32) as u16) - } - } - #[inline] - pub fn set_c(&mut self, val: ::std::os::raw::c_ushort) { - self._bitfield_1 &= !(4usize as u8); - self._bitfield_1 |= ((val as u16 as u8) << 2u32) & (4usize as u8); - } - #[inline] - pub fn at_offset_3(&self) -> ::std::os::raw::c_ushort { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & (8usize as u8)) >> - 3u32) as u16) - } - } - #[inline] - pub fn set_at_offset_3(&mut self, val: ::std::os::raw::c_ushort) { - self._bitfield_1 &= !(8usize as u8); - self._bitfield_1 |= ((val as u16 as u8) << 3u32) & (8usize as u8); - } - #[inline] - pub fn at_offset_4(&self) -> ::std::os::raw::c_ushort { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & (48usize as u8)) >> - 4u32) as u16) - } - } - #[inline] - pub fn set_at_offset_4(&mut self, val: ::std::os::raw::c_ushort) { - self._bitfield_1 &= !(48usize as u8); - self._bitfield_1 |= ((val as u16 as u8) << 4u32) & (48usize as u8); - } - #[inline] - pub fn d(&self) -> ::std::os::raw::c_ushort { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & (192usize as u8)) >> - 6u32) as u16) - } - } - #[inline] - pub fn set_d(&mut self, val: ::std::os::raw::c_ushort) { - self._bitfield_1 &= !(192usize as u8); - self._bitfield_1 |= ((val as u16 as u8) << 6u32) & (192usize as u8); - } - #[inline] - pub fn f(&self) -> ::std::os::raw::c_uint { - unsafe { - ::std::mem::transmute(((self._bitfield_2 & (3usize as u8)) >> - 0u32) as u32) - } - } - #[inline] - pub fn set_f(&mut self, val: ::std::os::raw::c_uint) { - self._bitfield_2 &= !(3usize as u8); - self._bitfield_2 |= ((val as u32 as u8) << 0u32) & (3usize as u8); - } - #[inline] - pub fn g(&self) -> ::std::os::raw::c_uint { - unsafe { - ::std::mem::transmute(((self._bitfield_3 & - (4294967295usize as u32)) >> 0u32) as - u32) - } - } - #[inline] - pub fn set_g(&mut self, val: ::std::os::raw::c_uint) { - self._bitfield_3 &= !(4294967295usize as u32); - self._bitfield_3 |= - ((val as u32 as u32) << 0u32) & (4294967295usize as u32); - } -} diff --git a/libbindgen/tests/expectations/tests/struct_with_derive_debug.rs b/libbindgen/tests/expectations/tests/struct_with_derive_debug.rs deleted file mode 100644 index 52906a81..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_derive_debug.rs +++ /dev/null @@ -1,50 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct LittleArray { - pub a: [::std::os::raw::c_int; 32usize], -} -#[test] -fn bindgen_test_layout_LittleArray() { - assert_eq!(::std::mem::size_of::<LittleArray>() , 128usize); - assert_eq!(::std::mem::align_of::<LittleArray>() , 4usize); -} -impl Clone for LittleArray { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -pub struct BigArray { - pub a: [::std::os::raw::c_int; 33usize], -} -#[test] -fn bindgen_test_layout_BigArray() { - assert_eq!(::std::mem::size_of::<BigArray>() , 132usize); - assert_eq!(::std::mem::align_of::<BigArray>() , 4usize); -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct WithLittleArray { - pub a: LittleArray, -} -#[test] -fn bindgen_test_layout_WithLittleArray() { - assert_eq!(::std::mem::size_of::<WithLittleArray>() , 128usize); - assert_eq!(::std::mem::align_of::<WithLittleArray>() , 4usize); -} -impl Clone for WithLittleArray { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -pub struct WithBigArray { - pub a: BigArray, -} -#[test] -fn bindgen_test_layout_WithBigArray() { - assert_eq!(::std::mem::size_of::<WithBigArray>() , 132usize); - assert_eq!(::std::mem::align_of::<WithBigArray>() , 4usize); -} diff --git a/libbindgen/tests/expectations/tests/struct_with_nesting.rs b/libbindgen/tests/expectations/tests/struct_with_nesting.rs deleted file mode 100644 index b3e0a5ca..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_nesting.rs +++ /dev/null @@ -1,94 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub a: ::std::os::raw::c_uint, - pub __bindgen_anon_1: foo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub b: __BindgenUnionField<::std::os::raw::c_uint>, - pub __bindgen_anon_1: __BindgenUnionField<foo__bindgen_ty_1__bindgen_ty_1>, - pub __bindgen_anon_2: __BindgenUnionField<foo__bindgen_ty_1__bindgen_ty_2>, - pub bindgen_union_field: u32, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1__bindgen_ty_1 { - pub c1: ::std::os::raw::c_ushort, - pub c2: ::std::os::raw::c_ushort, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1__bindgen_ty_1>() , - 4usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1__bindgen_ty_1>() , - 2usize); -} -impl Clone for foo__bindgen_ty_1__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1__bindgen_ty_2 { - pub d1: ::std::os::raw::c_uchar, - pub d2: ::std::os::raw::c_uchar, - pub d3: ::std::os::raw::c_uchar, - pub d4: ::std::os::raw::c_uchar, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1__bindgen_ty_2>() , - 4usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1__bindgen_ty_2>() , - 1usize); -} -impl Clone for foo__bindgen_ty_1__bindgen_ty_2 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 8usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/struct_with_packing.rs b/libbindgen/tests/expectations/tests/struct_with_packing.rs deleted file mode 100644 index 93fc3f11..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_packing.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C, packed)] -#[derive(Debug, Copy)] -pub struct a { - pub b: ::std::os::raw::c_char, - pub c: ::std::os::raw::c_short, -} -#[test] -fn bindgen_test_layout_a() { - assert_eq!(::std::mem::size_of::<a>() , 3usize); - assert_eq!(::std::mem::align_of::<a>() , 1usize); -} -impl Clone for a { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/struct_with_struct.rs b/libbindgen/tests/expectations/tests/struct_with_struct.rs deleted file mode 100644 index c8cdc927..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_struct.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub bar: foo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub x: ::std::os::raw::c_uint, - pub y: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 8usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/struct_with_typedef_template_arg.rs b/libbindgen/tests/expectations/tests/struct_with_typedef_template_arg.rs deleted file mode 100644 index 6f8d71f1..00000000 --- a/libbindgen/tests/expectations/tests/struct_with_typedef_template_arg.rs +++ /dev/null @@ -1,15 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Proxy<T, Args> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, - pub _phantom_1: ::std::marker::PhantomData<Args>, -} -pub type Proxy_foo<T> = - ::std::option::Option<unsafe extern "C" fn(bar: *mut T)>; diff --git a/libbindgen/tests/expectations/tests/template.rs b/libbindgen/tests/expectations/tests/template.rs deleted file mode 100644 index 5864ac73..00000000 --- a/libbindgen/tests/expectations/tests/template.rs +++ /dev/null @@ -1,184 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug)] -pub struct Foo<T, U> { - pub m_member: T, - pub m_member_ptr: *mut T, - pub m_member_arr: [T; 1usize], - pub _phantom_1: ::std::marker::PhantomData<U>, -} -#[test] -fn __bindgen_test_layout_template_1() { - assert_eq!(::std::mem::size_of::<Foo<::std::os::raw::c_int, ::std::os::raw::c_int>>() - , 24usize); - assert_eq!(::std::mem::align_of::<Foo<::std::os::raw::c_int, ::std::os::raw::c_int>>() - , 8usize); -} -extern "C" { - #[link_name = "_Z3bar3FooIiiE"] - pub fn bar(foo: Foo<::std::os::raw::c_int, ::std::os::raw::c_int>); -} -#[repr(C)] -#[derive(Debug)] -pub struct D<T> { - pub m_foo: D_MyFoo, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -pub type D_MyFoo = Foo<::std::os::raw::c_int, ::std::os::raw::c_int>; -#[repr(C)] -#[derive(Debug)] -pub struct D_U<T, Z> { - pub m_nested_foo: D_MyFoo, - pub m_baz: Z, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Rooted<T> { - pub prev: *mut T, - pub next: *mut Rooted<*mut ::std::os::raw::c_void>, - pub ptr: T, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct RootedContainer { - pub root: Rooted<*mut ::std::os::raw::c_void>, -} -#[test] -fn bindgen_test_layout_RootedContainer() { - assert_eq!(::std::mem::size_of::<RootedContainer>() , 24usize); - assert_eq!(::std::mem::align_of::<RootedContainer>() , 8usize); -} -impl Clone for RootedContainer { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug)] -pub struct WithDtor<T> { - pub member: T, -} -pub type WithDtorIntFwd = WithDtor<::std::os::raw::c_int>; -#[repr(C)] -#[derive(Debug)] -pub struct PODButContainsDtor { - pub member: WithDtorIntFwd, -} -#[test] -fn bindgen_test_layout_PODButContainsDtor() { - assert_eq!(::std::mem::size_of::<PODButContainsDtor>() , 4usize); - assert_eq!(::std::mem::align_of::<PODButContainsDtor>() , 4usize); -} -/** <div rustbindgen opaque> */ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Opaque<T> { - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct POD { - pub opaque_member: u32, -} -#[test] -fn bindgen_test_layout_POD() { - assert_eq!(::std::mem::size_of::<POD>() , 4usize); - assert_eq!(::std::mem::align_of::<POD>() , 4usize); -} -impl Clone for POD { - fn clone(&self) -> Self { *self } -} -/** - * <div rustbindgen replaces="NestedReplaced"></div> - */ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NestedReplaced<T> { - pub buff: *mut T, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NestedBase<T, U> { - pub buff: *mut T, - pub _phantom_1: ::std::marker::PhantomData<U>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Incomplete<T> { - pub d: T, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NestedContainer<T> { - pub c: T, - pub nested: NestedReplaced<T>, - pub inc: Incomplete<T>, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Untemplated { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Untemplated() { - assert_eq!(::std::mem::size_of::<Untemplated>() , 1usize); - assert_eq!(::std::mem::align_of::<Untemplated>() , 1usize); -} -impl Clone for Untemplated { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Templated<T> { - pub m_untemplated: Untemplated, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -/** - * If the replacement doesn't happen at the parse level the container would be - * copy and the replacement wouldn't, so this wouldn't compile. - * - * <div rustbindgen replaces="ReplacedWithoutDestructor"></div> - */ -#[repr(C)] -#[derive(Debug)] -pub struct ReplacedWithoutDestructor<T> { - pub buff: *mut T, -} -#[repr(C)] -#[derive(Debug)] -pub struct ShouldNotBeCopiable<T> { - pub m_member: ReplacedWithoutDestructor<T>, -} -#[repr(C)] -#[derive(Debug)] -pub struct ShouldNotBeCopiableAsWell<U> { - pub m_member: ReplacedWithoutDestructorFwd<U>, -} -/** - * If the replacement doesn't happen at the parse level the container would be - * copy and the replacement wouldn't, so this wouldn't compile. - * - * <div rustbindgen replaces="ReplacedWithoutDestructorFwd"></div> - */ -#[repr(C)] -#[derive(Debug)] -pub struct ReplacedWithoutDestructorFwd<T> { - pub buff: *mut T, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TemplateWithVar<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[test] -fn __bindgen_test_layout_template_2() { - assert_eq!(::std::mem::size_of::<WithDtor<::std::os::raw::c_int>>() , - 4usize); - assert_eq!(::std::mem::align_of::<WithDtor<::std::os::raw::c_int>>() , - 4usize); -} diff --git a/libbindgen/tests/expectations/tests/template_alias.rs b/libbindgen/tests/expectations/tests/template_alias.rs deleted file mode 100644 index d301a11c..00000000 --- a/libbindgen/tests/expectations/tests/template_alias.rs +++ /dev/null @@ -1,12 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type JS_detail_Wrapped<T> = T; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JS_Rooted<T> { - pub ptr: JS_detail_Wrapped<T>, -} diff --git a/libbindgen/tests/expectations/tests/template_alias_basic.rs b/libbindgen/tests/expectations/tests/template_alias_basic.rs deleted file mode 100644 index 656fff33..00000000 --- a/libbindgen/tests/expectations/tests/template_alias_basic.rs +++ /dev/null @@ -1,7 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type Wrapped<T> = T; diff --git a/libbindgen/tests/expectations/tests/template_alias_namespace.rs b/libbindgen/tests/expectations/tests/template_alias_namespace.rs deleted file mode 100644 index cf4a079c..00000000 --- a/libbindgen/tests/expectations/tests/template_alias_namespace.rs +++ /dev/null @@ -1,24 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - pub mod JS { - #[allow(unused_imports)] - use self::super::super::root; - pub mod detail { - #[allow(unused_imports)] - use self::super::super::super::root; - pub type Wrapped<T> = T; - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Rooted<T> { - pub ptr: root::JS::detail::Wrapped<T>, - } - } -} diff --git a/libbindgen/tests/expectations/tests/template_typedef_transitive_param.rs b/libbindgen/tests/expectations/tests/template_typedef_transitive_param.rs deleted file mode 100644 index 166ddc3c..00000000 --- a/libbindgen/tests/expectations/tests/template_typedef_transitive_param.rs +++ /dev/null @@ -1,18 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Wrapper<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Wrapper_Wrapped<T> { - pub t: T, -} -pub type Wrapper_Type<T> = Wrapper_Wrapped<T>; diff --git a/libbindgen/tests/expectations/tests/template_typedefs.rs b/libbindgen/tests/expectations/tests/template_typedefs.rs deleted file mode 100644 index 5f0d80b9..00000000 --- a/libbindgen/tests/expectations/tests/template_typedefs.rs +++ /dev/null @@ -1,22 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type foo = - ::std::option::Option<unsafe extern "C" fn(arg1: ::std::os::raw::c_int)>; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Foo<T, U> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, - pub _phantom_1: ::std::marker::PhantomData<U>, -} -pub type Foo_Char<T> = T; -pub type Foo_FooPtrTypedef<T> = *mut Foo_Char<T>; -pub type Foo_nsCOMArrayEnumFunc<T> = - ::std::option::Option<unsafe extern "C" fn(aElement: *mut T, - aData: - *mut ::std::os::raw::c_void) - -> bool>; diff --git a/libbindgen/tests/expectations/tests/templateref_opaque.rs b/libbindgen/tests/expectations/tests/templateref_opaque.rs deleted file mode 100644 index d69254c8..00000000 --- a/libbindgen/tests/expectations/tests/templateref_opaque.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct detail_PointerType<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -pub type detail_PointerType_Type<T> = *mut T; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UniquePtr<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -pub type UniquePtr_Pointer<T> = detail_PointerType<T>; diff --git a/libbindgen/tests/expectations/tests/type-referenced-by-whitelisted-function.rs b/libbindgen/tests/expectations/tests/type-referenced-by-whitelisted-function.rs deleted file mode 100644 index c9686501..00000000 --- a/libbindgen/tests/expectations/tests/type-referenced-by-whitelisted-function.rs +++ /dev/null @@ -1,22 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct dl_phdr_info { - pub x: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_dl_phdr_info() { - assert_eq!(::std::mem::size_of::<dl_phdr_info>() , 4usize); - assert_eq!(::std::mem::align_of::<dl_phdr_info>() , 4usize); -} -impl Clone for dl_phdr_info { - fn clone(&self) -> Self { *self } -} -extern "C" { - pub fn dl_iterate_phdr(arg1: *mut dl_phdr_info) -> ::std::os::raw::c_int; -} diff --git a/libbindgen/tests/expectations/tests/type_alias_empty.rs b/libbindgen/tests/expectations/tests/type_alias_empty.rs deleted file mode 100644 index 47e36006..00000000 --- a/libbindgen/tests/expectations/tests/type_alias_empty.rs +++ /dev/null @@ -1,7 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type bool_constant = (); diff --git a/libbindgen/tests/expectations/tests/type_alias_partial_template_especialization.rs b/libbindgen/tests/expectations/tests/type_alias_partial_template_especialization.rs deleted file mode 100644 index 70b5f66c..00000000 --- a/libbindgen/tests/expectations/tests/type_alias_partial_template_especialization.rs +++ /dev/null @@ -1,12 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type MaybeWrapped<A> = A; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Rooted<T> { - pub ptr: MaybeWrapped<T>, -} diff --git a/libbindgen/tests/expectations/tests/type_alias_template_specialized.rs b/libbindgen/tests/expectations/tests/type_alias_template_specialized.rs deleted file mode 100644 index 11813bc6..00000000 --- a/libbindgen/tests/expectations/tests/type_alias_template_specialized.rs +++ /dev/null @@ -1,21 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Rooted { - pub ptr: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Rooted() { - assert_eq!(::std::mem::size_of::<Rooted>() , 4usize); - assert_eq!(::std::mem::align_of::<Rooted>() , 4usize); -} -impl Clone for Rooted { - fn clone(&self) -> Self { *self } -} -/// <div rustbindgen replaces="MaybeWrapped"></div> -pub type MaybeWrapped<a> = a; diff --git a/libbindgen/tests/expectations/tests/typedefd-array-as-function-arg.rs b/libbindgen/tests/expectations/tests/typedefd-array-as-function-arg.rs deleted file mode 100644 index 56074f75..00000000 --- a/libbindgen/tests/expectations/tests/typedefd-array-as-function-arg.rs +++ /dev/null @@ -1,10 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub type myVector3 = [f32; 3usize]; -extern "C" { - pub fn modifyVectorFunc(v: *mut f32); -} diff --git a/libbindgen/tests/expectations/tests/typeref.rs b/libbindgen/tests/expectations/tests/typeref.rs deleted file mode 100644 index 1188393d..00000000 --- a/libbindgen/tests/expectations/tests/typeref.rs +++ /dev/null @@ -1,96 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct nsFoo { - pub mBar: mozilla_StyleShapeSource<::std::os::raw::c_int>, -} -#[test] -fn bindgen_test_layout_nsFoo() { - assert_eq!(::std::mem::size_of::<nsFoo>() , 8usize); - assert_eq!(::std::mem::align_of::<nsFoo>() , 8usize); -} -impl Clone for nsFoo { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct mozilla_FragmentOrURL { - pub mIsLocalRef: bool, -} -#[test] -fn bindgen_test_layout_mozilla_FragmentOrURL() { - assert_eq!(::std::mem::size_of::<mozilla_FragmentOrURL>() , 1usize); - assert_eq!(::std::mem::align_of::<mozilla_FragmentOrURL>() , 1usize); -} -impl Clone for mozilla_FragmentOrURL { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct mozilla_Position { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_mozilla_Position() { - assert_eq!(::std::mem::size_of::<mozilla_Position>() , 1usize); - assert_eq!(::std::mem::align_of::<mozilla_Position>() , 1usize); -} -impl Clone for mozilla_Position { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mozilla_StyleShapeSource<ReferenceBox> { - pub __bindgen_anon_1: mozilla_StyleShapeSource__bindgen_ty_1<ReferenceBox>, - pub _phantom_0: ::std::marker::PhantomData<ReferenceBox>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mozilla_StyleShapeSource__bindgen_ty_1<ReferenceBox> { - pub mPosition: __BindgenUnionField<*mut mozilla_Position>, - pub mFragmentOrURL: __BindgenUnionField<*mut mozilla_FragmentOrURL>, - pub bindgen_union_field: u64, - pub _phantom_0: ::std::marker::PhantomData<ReferenceBox>, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Bar { - pub mFoo: *mut nsFoo, -} -#[test] -fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 8usize); - assert_eq!(::std::mem::align_of::<Bar>() , 8usize); -} -impl Clone for Bar { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/union-in-ns.rs b/libbindgen/tests/expectations/tests/union-in-ns.rs deleted file mode 100644 index fa511e51..00000000 --- a/libbindgen/tests/expectations/tests/union-in-ns.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[repr(C)] - pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); - impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { - __BindgenUnionField(::std::marker::PhantomData) - } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { - ::std::mem::transmute(self) - } - } - impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } - } - impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } - } - impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } - impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } - } - #[allow(unused_imports)] - use self::super::root; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct bar { - pub baz: root::__BindgenUnionField<::std::os::raw::c_int>, - pub bindgen_union_field: u32, - } - #[test] - fn bindgen_test_layout_bar() { - assert_eq!(::std::mem::size_of::<bar>() , 4usize); - assert_eq!(::std::mem::align_of::<bar>() , 4usize); - } - impl Clone for bar { - fn clone(&self) -> Self { *self } - } -} diff --git a/libbindgen/tests/expectations/tests/union_dtor.rs b/libbindgen/tests/expectations/tests/union_dtor.rs deleted file mode 100644 index 9be626ff..00000000 --- a/libbindgen/tests/expectations/tests/union_dtor.rs +++ /dev/null @@ -1,42 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug)] -pub struct UnionWithDtor { - pub mFoo: __BindgenUnionField<::std::os::raw::c_int>, - pub mBar: __BindgenUnionField<*mut ::std::os::raw::c_void>, - pub bindgen_union_field: u64, -} -#[test] -fn bindgen_test_layout_UnionWithDtor() { - assert_eq!(::std::mem::size_of::<UnionWithDtor>() , 8usize); - assert_eq!(::std::mem::align_of::<UnionWithDtor>() , 8usize); -} diff --git a/libbindgen/tests/expectations/tests/union_fields.rs b/libbindgen/tests/expectations/tests/union_fields.rs deleted file mode 100644 index 21d87919..00000000 --- a/libbindgen/tests/expectations/tests/union_fields.rs +++ /dev/null @@ -1,47 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct _bindgen_ty_1 { - pub mInt: __BindgenUnionField<::std::os::raw::c_int>, - pub mFloat: __BindgenUnionField<f32>, - pub mPointer: __BindgenUnionField<*mut ::std::os::raw::c_void>, - pub bindgen_union_field: u64, -} -#[test] -fn bindgen_test_layout__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<_bindgen_ty_1>() , 8usize); - assert_eq!(::std::mem::align_of::<_bindgen_ty_1>() , 8usize); -} -impl Clone for _bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -pub use self::_bindgen_ty_1 as nsStyleUnion; diff --git a/libbindgen/tests/expectations/tests/union_template.rs b/libbindgen/tests/expectations/tests/union_template.rs deleted file mode 100644 index fc92afb8..00000000 --- a/libbindgen/tests/expectations/tests/union_template.rs +++ /dev/null @@ -1,62 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NastyStruct<T> { - pub mIsSome: bool, - pub mStorage: NastyStruct__bindgen_ty_1<T>, - pub __bindgen_anon_1: NastyStruct__bindgen_ty_2<T>, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NastyStruct__bindgen_ty_1<T> { - pub mFoo: __BindgenUnionField<*mut ::std::os::raw::c_void>, - pub mDummy: __BindgenUnionField<::std::os::raw::c_ulong>, - pub bindgen_union_field: u64, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NastyStruct__bindgen_ty_2<T> { - pub wat: __BindgenUnionField<::std::os::raw::c_short>, - pub wut: __BindgenUnionField<*mut ::std::os::raw::c_int>, - pub bindgen_union_field: u64, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Whatever<T> { - pub mTPtr: __BindgenUnionField<*mut ::std::os::raw::c_void>, - pub mInt: __BindgenUnionField<::std::os::raw::c_int>, - pub bindgen_union_field: u64, - pub _phantom_0: ::std::marker::PhantomData<T>, -} diff --git a/libbindgen/tests/expectations/tests/union_with_anon_struct.rs b/libbindgen/tests/expectations/tests/union_with_anon_struct.rs deleted file mode 100644 index f0a21512..00000000 --- a/libbindgen/tests/expectations/tests/union_with_anon_struct.rs +++ /dev/null @@ -1,58 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub bar: __BindgenUnionField<foo__bindgen_ty_1>, - pub bindgen_union_field: [u32; 2usize], -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub a: ::std::os::raw::c_uint, - pub b: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 8usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/union_with_anon_struct_bitfield.rs b/libbindgen/tests/expectations/tests/union_with_anon_struct_bitfield.rs deleted file mode 100644 index 548b0dc4..00000000 --- a/libbindgen/tests/expectations/tests/union_with_anon_struct_bitfield.rs +++ /dev/null @@ -1,86 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub a: __BindgenUnionField<::std::os::raw::c_int>, - pub __bindgen_anon_1: __BindgenUnionField<foo__bindgen_ty_1>, - pub bindgen_union_field: u32, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub _bitfield_1: u32, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -impl foo__bindgen_ty_1 { - #[inline] - pub fn b(&self) -> ::std::os::raw::c_int { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & (127usize as u32)) >> - 0u32) as u32) - } - } - #[inline] - pub fn set_b(&mut self, val: ::std::os::raw::c_int) { - self._bitfield_1 &= !(127usize as u32); - self._bitfield_1 |= ((val as u32 as u32) << 0u32) & (127usize as u32); - } - #[inline] - pub fn c(&self) -> ::std::os::raw::c_int { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & - (4294967168usize as u32)) >> 7u32) as - u32) - } - } - #[inline] - pub fn set_c(&mut self, val: ::std::os::raw::c_int) { - self._bitfield_1 &= !(4294967168usize as u32); - self._bitfield_1 |= - ((val as u32 as u32) << 7u32) & (4294967168usize as u32); - } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 4usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/union_with_anon_union.rs b/libbindgen/tests/expectations/tests/union_with_anon_union.rs deleted file mode 100644 index 95278556..00000000 --- a/libbindgen/tests/expectations/tests/union_with_anon_union.rs +++ /dev/null @@ -1,59 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub bar: __BindgenUnionField<foo__bindgen_ty_1>, - pub bindgen_union_field: u32, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub a: __BindgenUnionField<::std::os::raw::c_uint>, - pub b: __BindgenUnionField<::std::os::raw::c_ushort>, - pub bindgen_union_field: u32, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 4usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/union_with_anon_unnamed_struct.rs b/libbindgen/tests/expectations/tests/union_with_anon_unnamed_struct.rs deleted file mode 100644 index 2d6fab97..00000000 --- a/libbindgen/tests/expectations/tests/union_with_anon_unnamed_struct.rs +++ /dev/null @@ -1,61 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct pixel { - pub rgba: __BindgenUnionField<::std::os::raw::c_uint>, - pub __bindgen_anon_1: __BindgenUnionField<pixel__bindgen_ty_1>, - pub bindgen_union_field: u32, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct pixel__bindgen_ty_1 { - pub r: ::std::os::raw::c_uchar, - pub g: ::std::os::raw::c_uchar, - pub b: ::std::os::raw::c_uchar, - pub a: ::std::os::raw::c_uchar, -} -#[test] -fn bindgen_test_layout_pixel__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<pixel__bindgen_ty_1>() , 4usize); - assert_eq!(::std::mem::align_of::<pixel__bindgen_ty_1>() , 1usize); -} -impl Clone for pixel__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_pixel() { - assert_eq!(::std::mem::size_of::<pixel>() , 4usize); - assert_eq!(::std::mem::align_of::<pixel>() , 4usize); -} -impl Clone for pixel { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/union_with_anon_unnamed_union.rs b/libbindgen/tests/expectations/tests/union_with_anon_unnamed_union.rs deleted file mode 100644 index eb214017..00000000 --- a/libbindgen/tests/expectations/tests/union_with_anon_unnamed_union.rs +++ /dev/null @@ -1,60 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub a: __BindgenUnionField<::std::os::raw::c_uint>, - pub __bindgen_anon_1: __BindgenUnionField<foo__bindgen_ty_1>, - pub bindgen_union_field: u32, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub b: __BindgenUnionField<::std::os::raw::c_ushort>, - pub c: __BindgenUnionField<::std::os::raw::c_uchar>, - pub bindgen_union_field: u16, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 2usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 2usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 4usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/union_with_big_member.rs b/libbindgen/tests/expectations/tests/union_with_big_member.rs deleted file mode 100644 index b921f33c..00000000 --- a/libbindgen/tests/expectations/tests/union_with_big_member.rs +++ /dev/null @@ -1,75 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Copy)] -pub struct WithBigArray { - pub a: __BindgenUnionField<::std::os::raw::c_int>, - pub b: __BindgenUnionField<[::std::os::raw::c_int; 33usize]>, - pub bindgen_union_field: [u32; 33usize], -} -#[test] -fn bindgen_test_layout_WithBigArray() { - assert_eq!(::std::mem::size_of::<WithBigArray>() , 132usize); - assert_eq!(::std::mem::align_of::<WithBigArray>() , 4usize); -} -impl Clone for WithBigArray { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct WithBigArray2 { - pub a: __BindgenUnionField<::std::os::raw::c_int>, - pub b: __BindgenUnionField<[::std::os::raw::c_char; 33usize]>, - pub bindgen_union_field: [u32; 9usize], -} -#[test] -fn bindgen_test_layout_WithBigArray2() { - assert_eq!(::std::mem::size_of::<WithBigArray2>() , 36usize); - assert_eq!(::std::mem::align_of::<WithBigArray2>() , 4usize); -} -impl Clone for WithBigArray2 { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Copy)] -pub struct WithBigMember { - pub a: __BindgenUnionField<::std::os::raw::c_int>, - pub b: __BindgenUnionField<WithBigArray>, - pub bindgen_union_field: [u32; 33usize], -} -#[test] -fn bindgen_test_layout_WithBigMember() { - assert_eq!(::std::mem::size_of::<WithBigMember>() , 132usize); - assert_eq!(::std::mem::align_of::<WithBigMember>() , 4usize); -} -impl Clone for WithBigMember { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/union_with_nesting.rs b/libbindgen/tests/expectations/tests/union_with_nesting.rs deleted file mode 100644 index af9e442d..00000000 --- a/libbindgen/tests/expectations/tests/union_with_nesting.rs +++ /dev/null @@ -1,93 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); -impl <T> __BindgenUnionField<T> { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl <T> ::std::default::Default for __BindgenUnionField<T> { - #[inline] - fn default() -> Self { Self::new() } -} -impl <T> ::std::clone::Clone for __BindgenUnionField<T> { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl <T> ::std::marker::Copy for __BindgenUnionField<T> { } -impl <T> ::std::fmt::Debug for __BindgenUnionField<T> { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub a: __BindgenUnionField<::std::os::raw::c_uint>, - pub __bindgen_anon_1: __BindgenUnionField<foo__bindgen_ty_1>, - pub bindgen_union_field: u32, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1 { - pub __bindgen_anon_1: foo__bindgen_ty_1__bindgen_ty_1, - pub __bindgen_anon_2: foo__bindgen_ty_1__bindgen_ty_2, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1__bindgen_ty_1 { - pub b1: __BindgenUnionField<::std::os::raw::c_ushort>, - pub b2: __BindgenUnionField<::std::os::raw::c_ushort>, - pub bindgen_union_field: u16, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1__bindgen_ty_1>() , - 2usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1__bindgen_ty_1>() , - 2usize); -} -impl Clone for foo__bindgen_ty_1__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo__bindgen_ty_1__bindgen_ty_2 { - pub c1: __BindgenUnionField<::std::os::raw::c_ushort>, - pub c2: __BindgenUnionField<::std::os::raw::c_ushort>, - pub bindgen_union_field: u16, -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1__bindgen_ty_2>() , - 2usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1__bindgen_ty_2>() , - 2usize); -} -impl Clone for foo__bindgen_ty_1__bindgen_ty_2 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo__bindgen_ty_1() { - assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize); - assert_eq!(::std::mem::align_of::<foo__bindgen_ty_1>() , 2usize); -} -impl Clone for foo__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 4usize); - assert_eq!(::std::mem::align_of::<foo>() , 4usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/unknown_attr.rs b/libbindgen/tests/expectations/tests/unknown_attr.rs deleted file mode 100644 index 541bee5d..00000000 --- a/libbindgen/tests/expectations/tests/unknown_attr.rs +++ /dev/null @@ -1,16 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct _bindgen_ty_1 { - pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, - pub __clang_max_align_nonce2: f64, -} -impl Clone for _bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -pub use self::_bindgen_ty_1 as max_align_t; diff --git a/libbindgen/tests/expectations/tests/use-core.rs b/libbindgen/tests/expectations/tests/use-core.rs deleted file mode 100644 index b0900f5f..00000000 --- a/libbindgen/tests/expectations/tests/use-core.rs +++ /dev/null @@ -1,24 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - -extern crate core; - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub a: ::std::os::raw::c_int, - pub b: ::std::os::raw::c_int, - pub bar: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::core::mem::size_of::<foo>() , 16usize); - assert_eq!(::core::mem::align_of::<foo>() , 8usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} -pub type fooFunction = - ::core::option::Option<unsafe extern "C" fn(bar: ::std::os::raw::c_int)>; diff --git a/libbindgen/tests/expectations/tests/using.rs b/libbindgen/tests/expectations/tests/using.rs deleted file mode 100644 index dbb6c84f..00000000 --- a/libbindgen/tests/expectations/tests/using.rs +++ /dev/null @@ -1,14 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Point<T> { - pub x: T, - pub y: T, -} -pub type IntPoint2D = Point<::std::os::raw::c_int>; -pub type IntVec2D = Point<::std::os::raw::c_int>; diff --git a/libbindgen/tests/expectations/tests/var-tracing.rs b/libbindgen/tests/expectations/tests/var-tracing.rs deleted file mode 100644 index 75c5ebe3..00000000 --- a/libbindgen/tests/expectations/tests/var-tracing.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Bar { - pub m_baz: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 4usize); - assert_eq!(::std::mem::align_of::<Bar>() , 4usize); -} -extern "C" { - #[link_name = "_ZN3BarC1Ei"] - pub fn Bar_Bar(this: *mut Bar, baz: ::std::os::raw::c_int); -} -impl Clone for Bar { - fn clone(&self) -> Self { *self } -} -impl Bar { - #[inline] - pub unsafe fn new(baz: ::std::os::raw::c_int) -> Self { - let mut __bindgen_tmp = ::std::mem::uninitialized(); - Bar_Bar(&mut __bindgen_tmp, baz); - __bindgen_tmp - } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Baz { - pub _address: u8, -} -extern "C" { - #[link_name = "_ZN3Baz3FOOE"] - pub static mut Baz_FOO: *const Bar; -} -#[test] -fn bindgen_test_layout_Baz() { - assert_eq!(::std::mem::size_of::<Baz>() , 1usize); - assert_eq!(::std::mem::align_of::<Baz>() , 1usize); -} -impl Clone for Baz { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/variadic-method.rs b/libbindgen/tests/expectations/tests/variadic-method.rs deleted file mode 100644 index 34301069..00000000 --- a/libbindgen/tests/expectations/tests/variadic-method.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -extern "C" { - #[link_name = "_Z3fooPKcz"] - pub fn foo(fmt: *const ::std::os::raw::c_char, ...); -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Bar { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Bar() { - assert_eq!(::std::mem::size_of::<Bar>() , 1usize); - assert_eq!(::std::mem::align_of::<Bar>() , 1usize); -} -extern "C" { - #[link_name = "_ZN3Bar3fooEPKcz"] - pub fn Bar_foo(this: *mut Bar, fmt: *const ::std::os::raw::c_char, ...); -} -impl Clone for Bar { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/variadic_template_function.rs b/libbindgen/tests/expectations/tests/variadic_template_function.rs deleted file mode 100644 index cd99df96..00000000 --- a/libbindgen/tests/expectations/tests/variadic_template_function.rs +++ /dev/null @@ -1,12 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VariadicFunctionObject<T> { - pub _address: u8, - pub _phantom_0: ::std::marker::PhantomData<T>, -} diff --git a/libbindgen/tests/expectations/tests/vector.rs b/libbindgen/tests/expectations/tests/vector.rs deleted file mode 100644 index b8ca5735..00000000 --- a/libbindgen/tests/expectations/tests/vector.rs +++ /dev/null @@ -1,19 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct foo { - pub mMember: [::std::os::raw::c_longlong; 1usize], -} -#[test] -fn bindgen_test_layout_foo() { - assert_eq!(::std::mem::size_of::<foo>() , 8usize); - assert_eq!(::std::mem::align_of::<foo>() , 8usize); -} -impl Clone for foo { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/virtual_dtor.rs b/libbindgen/tests/expectations/tests/virtual_dtor.rs deleted file mode 100644 index 9571f084..00000000 --- a/libbindgen/tests/expectations/tests/virtual_dtor.rs +++ /dev/null @@ -1,19 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct nsSlots__bindgen_vtable { -} -#[repr(C)] -#[derive(Debug)] -pub struct nsSlots { - pub vtable_: *const nsSlots__bindgen_vtable, -} -#[test] -fn bindgen_test_layout_nsSlots() { - assert_eq!(::std::mem::size_of::<nsSlots>() , 8usize); - assert_eq!(::std::mem::align_of::<nsSlots>() , 8usize); -} diff --git a/libbindgen/tests/expectations/tests/virtual_inheritance.rs b/libbindgen/tests/expectations/tests/virtual_inheritance.rs deleted file mode 100644 index f271223f..00000000 --- a/libbindgen/tests/expectations/tests/virtual_inheritance.rs +++ /dev/null @@ -1,68 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct A { - pub foo: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_A() { - assert_eq!(::std::mem::size_of::<A>() , 4usize); - assert_eq!(::std::mem::align_of::<A>() , 4usize); -} -impl Clone for A { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -pub struct B__bindgen_vtable { -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct B { - pub vtable_: *const B__bindgen_vtable, - pub bar: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_B() { - assert_eq!(::std::mem::size_of::<B>() , 16usize); - assert_eq!(::std::mem::align_of::<B>() , 8usize); -} -impl Clone for B { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -pub struct C__bindgen_vtable { -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C { - pub vtable_: *const C__bindgen_vtable, - pub baz: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_C() { - assert_eq!(::std::mem::size_of::<C>() , 16usize); - assert_eq!(::std::mem::align_of::<C>() , 8usize); -} -impl Clone for C { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct D { - pub _base: C, - pub _base_1: B, - pub bazz: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_D() { - assert_eq!(::std::mem::size_of::<D>() , 40usize); - assert_eq!(::std::mem::align_of::<D>() , 8usize); -} -impl Clone for D { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/virtual_overloaded.rs b/libbindgen/tests/expectations/tests/virtual_overloaded.rs deleted file mode 100644 index 7833cdbf..00000000 --- a/libbindgen/tests/expectations/tests/virtual_overloaded.rs +++ /dev/null @@ -1,22 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -pub struct C__bindgen_vtable { -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct C { - pub vtable_: *const C__bindgen_vtable, -} -#[test] -fn bindgen_test_layout_C() { - assert_eq!(::std::mem::size_of::<C>() , 8usize); - assert_eq!(::std::mem::align_of::<C>() , 8usize); -} -impl Clone for C { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/vtable_recursive_sig.rs b/libbindgen/tests/expectations/tests/vtable_recursive_sig.rs deleted file mode 100644 index ce62eeb0..00000000 --- a/libbindgen/tests/expectations/tests/vtable_recursive_sig.rs +++ /dev/null @@ -1,35 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Derived { - pub _base: Base, -} -#[test] -fn bindgen_test_layout_Derived() { - assert_eq!(::std::mem::size_of::<Derived>() , 8usize); - assert_eq!(::std::mem::align_of::<Derived>() , 8usize); -} -impl Clone for Derived { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -pub struct Base__bindgen_vtable { -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Base { - pub vtable_: *const Base__bindgen_vtable, -} -#[test] -fn bindgen_test_layout_Base() { - assert_eq!(::std::mem::size_of::<Base>() , 8usize); - assert_eq!(::std::mem::align_of::<Base>() , 8usize); -} -impl Clone for Base { - fn clone(&self) -> Self { *self } -} diff --git a/libbindgen/tests/expectations/tests/weird_bitfields.rs b/libbindgen/tests/expectations/tests/weird_bitfields.rs deleted file mode 100644 index 56ee76a5..00000000 --- a/libbindgen/tests/expectations/tests/weird_bitfields.rs +++ /dev/null @@ -1,128 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum nsStyleSVGOpacitySource { - eStyleSVGOpacitySource_Normal = 0, - eStyleSVGOpacitySource_ContextFillOpacity = 1, - eStyleSVGOpacitySource_ContextStrokeOpacity = 2, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct Weird { - pub mStrokeDasharrayLength: ::std::os::raw::c_uint, - pub _bitfield_1: u32, - pub mClipRule: ::std::os::raw::c_uchar, - pub mColorInterpolation: ::std::os::raw::c_uchar, - pub mColorInterpolationFilters: ::std::os::raw::c_uchar, - pub mFillRule: ::std::os::raw::c_uchar, - pub mImageRendering: ::std::os::raw::c_uchar, - pub mPaintOrder: ::std::os::raw::c_uchar, - pub mShapeRendering: ::std::os::raw::c_uchar, - pub mStrokeLinecap: ::std::os::raw::c_uchar, - pub mStrokeLinejoin: ::std::os::raw::c_uchar, - pub mTextAnchor: ::std::os::raw::c_uchar, - pub mTextRendering: ::std::os::raw::c_uchar, - pub _bitfield_2: u16, -} -#[test] -fn bindgen_test_layout_Weird() { - assert_eq!(::std::mem::size_of::<Weird>() , 24usize); - assert_eq!(::std::mem::align_of::<Weird>() , 4usize); -} -impl Clone for Weird { - fn clone(&self) -> Self { *self } -} -impl Weird { - #[inline] - pub fn bitTest(&self) -> ::std::os::raw::c_uint { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & (65535usize as u32)) >> - 0u32) as u32) - } - } - #[inline] - pub fn set_bitTest(&mut self, val: ::std::os::raw::c_uint) { - self._bitfield_1 &= !(65535usize as u32); - self._bitfield_1 |= - ((val as u32 as u32) << 0u32) & (65535usize as u32); - } - #[inline] - pub fn bitTest2(&self) -> ::std::os::raw::c_uint { - unsafe { - ::std::mem::transmute(((self._bitfield_1 & - (2147418112usize as u32)) >> 16u32) as - u32) - } - } - #[inline] - pub fn set_bitTest2(&mut self, val: ::std::os::raw::c_uint) { - self._bitfield_1 &= !(2147418112usize as u32); - self._bitfield_1 |= - ((val as u32 as u32) << 16u32) & (2147418112usize as u32); - } - #[inline] - pub fn mFillOpacitySource(&self) -> nsStyleSVGOpacitySource { - unsafe { - ::std::mem::transmute(((self._bitfield_2 & (7usize as u16)) >> - 0u32) as u32) - } - } - #[inline] - pub fn set_mFillOpacitySource(&mut self, val: nsStyleSVGOpacitySource) { - self._bitfield_2 &= !(7usize as u16); - self._bitfield_2 |= ((val as u32 as u16) << 0u32) & (7usize as u16); - } - #[inline] - pub fn mStrokeOpacitySource(&self) -> nsStyleSVGOpacitySource { - unsafe { - ::std::mem::transmute(((self._bitfield_2 & (56usize as u16)) >> - 3u32) as u32) - } - } - #[inline] - pub fn set_mStrokeOpacitySource(&mut self, val: nsStyleSVGOpacitySource) { - self._bitfield_2 &= !(56usize as u16); - self._bitfield_2 |= ((val as u32 as u16) << 3u32) & (56usize as u16); - } - #[inline] - pub fn mStrokeDasharrayFromObject(&self) -> bool { - unsafe { - ::std::mem::transmute(((self._bitfield_2 & (64usize as u16)) >> - 6u32) as u8) - } - } - #[inline] - pub fn set_mStrokeDasharrayFromObject(&mut self, val: bool) { - self._bitfield_2 &= !(64usize as u16); - self._bitfield_2 |= ((val as u8 as u16) << 6u32) & (64usize as u16); - } - #[inline] - pub fn mStrokeDashoffsetFromObject(&self) -> bool { - unsafe { - ::std::mem::transmute(((self._bitfield_2 & (128usize as u16)) >> - 7u32) as u8) - } - } - #[inline] - pub fn set_mStrokeDashoffsetFromObject(&mut self, val: bool) { - self._bitfield_2 &= !(128usize as u16); - self._bitfield_2 |= ((val as u8 as u16) << 7u32) & (128usize as u16); - } - #[inline] - pub fn mStrokeWidthFromObject(&self) -> bool { - unsafe { - ::std::mem::transmute(((self._bitfield_2 & (256usize as u16)) >> - 8u32) as u8) - } - } - #[inline] - pub fn set_mStrokeWidthFromObject(&mut self, val: bool) { - self._bitfield_2 &= !(256usize as u16); - self._bitfield_2 |= ((val as u8 as u16) << 8u32) & (256usize as u16); - } -} diff --git a/libbindgen/tests/expectations/tests/what_is_going_on.rs b/libbindgen/tests/expectations/tests/what_is_going_on.rs deleted file mode 100644 index 6f1998d1..00000000 --- a/libbindgen/tests/expectations/tests/what_is_going_on.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy)] -pub struct UnknownUnits { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_UnknownUnits() { - assert_eq!(::std::mem::size_of::<UnknownUnits>() , 1usize); - assert_eq!(::std::mem::align_of::<UnknownUnits>() , 1usize); -} -impl Clone for UnknownUnits { - fn clone(&self) -> Self { *self } -} -pub type Float = f32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct PointTyped<units, F> { - pub x: F, - pub y: F, - pub _phantom_0: ::std::marker::PhantomData<units>, -} -pub type IntPoint = PointTyped<UnknownUnits, f32>; diff --git a/libbindgen/tests/expectations/tests/whitelist-namespaces-basic.rs b/libbindgen/tests/expectations/tests/whitelist-namespaces-basic.rs deleted file mode 100644 index cbb12f6b..00000000 --- a/libbindgen/tests/expectations/tests/whitelist-namespaces-basic.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - pub mod outer { - #[allow(unused_imports)] - use self::super::super::root; - pub mod inner { - #[allow(unused_imports)] - use self::super::super::super::root; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Helper { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_Helper() { - assert_eq!(::std::mem::size_of::<Helper>() , 1usize); - assert_eq!(::std::mem::align_of::<Helper>() , 1usize); - } - impl Clone for Helper { - fn clone(&self) -> Self { *self } - } - } - } -} diff --git a/libbindgen/tests/expectations/tests/whitelist-namespaces.rs b/libbindgen/tests/expectations/tests/whitelist-namespaces.rs deleted file mode 100644 index bc257af6..00000000 --- a/libbindgen/tests/expectations/tests/whitelist-namespaces.rs +++ /dev/null @@ -1,44 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub mod root { - #[allow(unused_imports)] - use self::super::root; - pub mod outer { - #[allow(unused_imports)] - use self::super::super::root; - pub mod inner { - #[allow(unused_imports)] - use self::super::super::super::root; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Helper { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_Helper() { - assert_eq!(::std::mem::size_of::<Helper>() , 1usize); - assert_eq!(::std::mem::align_of::<Helper>() , 1usize); - } - impl Clone for Helper { - fn clone(&self) -> Self { *self } - } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct Test { - pub helper: root::outer::inner::Helper, - } - #[test] - fn bindgen_test_layout_Test() { - assert_eq!(::std::mem::size_of::<Test>() , 1usize); - assert_eq!(::std::mem::align_of::<Test>() , 1usize); - } - impl Clone for Test { - fn clone(&self) -> Self { *self } - } - } -} diff --git a/libbindgen/tests/expectations/tests/whitelist_basic.rs b/libbindgen/tests/expectations/tests/whitelist_basic.rs deleted file mode 100644 index 0104f049..00000000 --- a/libbindgen/tests/expectations/tests/whitelist_basic.rs +++ /dev/null @@ -1,18 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct WhitelistMe<T> { - pub foo: ::std::os::raw::c_int, - pub bar: WhitelistMe_Inner<T>, - pub _phantom_0: ::std::marker::PhantomData<T>, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct WhitelistMe_Inner<T> { - pub bar: T, -} diff --git a/libbindgen/tests/expectations/tests/whitelist_fix.rs b/libbindgen/tests/expectations/tests/whitelist_fix.rs deleted file mode 100644 index 9e26e1be..00000000 --- a/libbindgen/tests/expectations/tests/whitelist_fix.rs +++ /dev/null @@ -1,10 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - -pub enum Test {} - -extern "C" { - pub fn Servo_Test(a: *mut Test); -} diff --git a/libbindgen/tests/expectations/tests/whitelist_vars.rs b/libbindgen/tests/expectations/tests/whitelist_vars.rs deleted file mode 100644 index f7af24b2..00000000 --- a/libbindgen/tests/expectations/tests/whitelist_vars.rs +++ /dev/null @@ -1,10 +0,0 @@ -/* automatically generated by rust-bindgen */ - - -#![allow(non_snake_case)] - - -pub const NONE: ::std::os::raw::c_uint = 0; -pub const FOO: ::std::os::raw::c_uint = 5; -pub const FOOB: ::std::os::raw::c_int = -2; -pub const FOOBAR: ::std::os::raw::c_int = -10; diff --git a/libbindgen/tests/headers/accessors.hpp b/libbindgen/tests/headers/accessors.hpp deleted file mode 100644 index 4c23e35d..00000000 --- a/libbindgen/tests/headers/accessors.hpp +++ /dev/null @@ -1,46 +0,0 @@ -struct SomeAccessors { - int mNoAccessor; - /** <div rustbindgen accessor></div> */ - int mBothAccessors; - /** <div rustbindgen accessor="unsafe"></div> */ - int mUnsafeAccessors; - /** <div rustbindgen accessor="immutable"></div> */ - int mImmutableAccessor; -}; - -/** <div rustbindgen accessor></div> */ -struct AllAccessors { - int mBothAccessors; - int mAlsoBothAccessors; -}; - -/** <div rustbindgen accessor="unsafe"></div> */ -struct AllUnsafeAccessors { - int mBothAccessors; - int mAlsoBothAccessors; -}; - -/** <div rustbindgen accessor></div> */ -struct ContradictAccessors { - int mBothAccessors; - /** <div rustbindgen accessor="false"></div> */ - int mNoAccessors; - /** <div rustbindgen accessor="unsafe"></div> */ - int mUnsafeAccessors; - /** <div rustbindgen accessor="immutable"></div> */ - int mImmutableAccessor; -}; - -/** <div rustbindgen accessor replaces="Replaced"></div> */ -struct Replacing { - int mAccessor; -}; - -struct Replaced { - int noOp; -}; - -/** <div rustbindgen accessor></div> */ -struct Wrapper { - Replaced mReplaced; -}; diff --git a/libbindgen/tests/headers/annotation_hide.hpp b/libbindgen/tests/headers/annotation_hide.hpp deleted file mode 100644 index 3c82c9a2..00000000 --- a/libbindgen/tests/headers/annotation_hide.hpp +++ /dev/null @@ -1,16 +0,0 @@ - -/** - * <div rustbindgen="true" hide="true"></div> - */ -struct C; - -/** - * <div rustbindgen opaque></div> - */ -struct D { - int a; -}; - -struct NotAnnotated { - int f; -}; diff --git a/libbindgen/tests/headers/anon_enum.hpp b/libbindgen/tests/headers/anon_enum.hpp deleted file mode 100644 index 1961fe6c..00000000 --- a/libbindgen/tests/headers/anon_enum.hpp +++ /dev/null @@ -1,10 +0,0 @@ -struct Test { - int foo; - float bar; - enum { T_NONE }; -}; - -typedef enum { - Foo, - Bar, -} Baz; diff --git a/libbindgen/tests/headers/anon_enum_trait.hpp b/libbindgen/tests/headers/anon_enum_trait.hpp deleted file mode 100644 index e1ec394c..00000000 --- a/libbindgen/tests/headers/anon_enum_trait.hpp +++ /dev/null @@ -1,22 +0,0 @@ - -template<typename _Tp> -class DataType { -public: - typedef _Tp value_type; - typedef value_type work_type; - typedef value_type channel_type; - typedef value_type vec_type; - enum { generic_type = 1, - depth = -1, - channels = 1, - fmt = 0, - type = -1, - }; -}; - -struct Foo { - enum { - Bar = 0, - Baz = 0, - }; -}; diff --git a/libbindgen/tests/headers/anon_enum_whitelist.h b/libbindgen/tests/headers/anon_enum_whitelist.h deleted file mode 100644 index 15cda6b1..00000000 --- a/libbindgen/tests/headers/anon_enum_whitelist.h +++ /dev/null @@ -1,6 +0,0 @@ -// bindgen-flags: --whitelist-var NODE_.* - -enum { - NODE_FLAG_FOO, - NODE_FLAG_BAR, -}; diff --git a/libbindgen/tests/headers/anon_union.hpp b/libbindgen/tests/headers/anon_union.hpp deleted file mode 100644 index 126f6a6e..00000000 --- a/libbindgen/tests/headers/anon_union.hpp +++ /dev/null @@ -1,20 +0,0 @@ -template<typename T> -struct TErrorResult { - enum UnionState { - HasMessage, - HasException, - }; - int mResult; - struct Message; - struct DOMExceptionInfo; - union { - Message* mMessage; - DOMExceptionInfo* mDOMExceptionInfo; - }; - - bool mMightHaveUnreported; - UnionState mUnionState; -}; - -struct ErrorResult : public TErrorResult<int> { -}; diff --git a/libbindgen/tests/headers/arg_keyword.hpp b/libbindgen/tests/headers/arg_keyword.hpp deleted file mode 100644 index 9f0af850..00000000 --- a/libbindgen/tests/headers/arg_keyword.hpp +++ /dev/null @@ -1 +0,0 @@ -void foo(const char* type); diff --git a/libbindgen/tests/headers/auto.hpp b/libbindgen/tests/headers/auto.hpp deleted file mode 100644 index b5f6d5f3..00000000 --- a/libbindgen/tests/headers/auto.hpp +++ /dev/null @@ -1,19 +0,0 @@ -// bindgen-flags: -- -std=c++14 -// bindgen-unstable - -class Foo { - static constexpr auto kFoo = 2 == 2; -}; - -template<typename T> -class Bar { - static const constexpr auto kBar = T(1); -}; - -template<typename T> auto Test1() { - return T(1); -} - -auto Test2() { - return Test1<unsigned int>(); -} diff --git a/libbindgen/tests/headers/bad-namespace-parenthood-inheritance.hpp b/libbindgen/tests/headers/bad-namespace-parenthood-inheritance.hpp deleted file mode 100644 index ce21a401..00000000 --- a/libbindgen/tests/headers/bad-namespace-parenthood-inheritance.hpp +++ /dev/null @@ -1,15 +0,0 @@ -namespace std -{ - template < typename > struct char_traits; -} -namespace __gnu_cxx -{ - template < typename > struct char_traits; -} -namespace std -{ - template < class _CharT > struct char_traits:__gnu_cxx::char_traits < - _CharT > - { - }; -} diff --git a/libbindgen/tests/headers/base-to-derived.hpp b/libbindgen/tests/headers/base-to-derived.hpp deleted file mode 100644 index ea31e0f2..00000000 --- a/libbindgen/tests/headers/base-to-derived.hpp +++ /dev/null @@ -1,19 +0,0 @@ -// bindgen-flags: -- -std=c++11 - -struct false_type {}; - -template<typename _From, typename _To, bool> -struct __is_base_to_derived_ref; - -template<typename _From, typename _To> -struct __is_base_to_derived_ref<_From, _To, true> -{ - typedef _To type; - - static constexpr bool value = type::value; -}; - -template<typename _From, typename _To> -struct __is_base_to_derived_ref<_From, _To, false> -: public false_type -{ }; diff --git a/libbindgen/tests/headers/bitfield-enum-basic.hpp b/libbindgen/tests/headers/bitfield-enum-basic.hpp deleted file mode 100644 index 364bebf2..00000000 --- a/libbindgen/tests/headers/bitfield-enum-basic.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// bindgen-flags: --bitfield-enum "Foo|Buz|NS_.*|DUMMY_.*" -- -std=c++11 - -enum Foo { - Bar = 1 << 1, - Baz = 1 << 2, - Duplicated = 1 << 2, - Negative = -3, -}; - -enum class Buz : signed char { - Bar = 1 << 1, - Baz = 1 << 2, - Duplicated = 1 << 2, - Negative = -3, -}; - -enum { - NS_FOO = 1 << 0, - NS_BAR = 1 << 1, -}; - -class Dummy { - enum { - DUMMY_FOO = 1 << 0, - DUMMY_BAR = 1 << 1, - }; -}; diff --git a/libbindgen/tests/headers/bitfield_method_mangling.h b/libbindgen/tests/headers/bitfield_method_mangling.h deleted file mode 100644 index 257648ee..00000000 --- a/libbindgen/tests/headers/bitfield_method_mangling.h +++ /dev/null @@ -1,5 +0,0 @@ -typedef struct -{ - unsigned int pad3: 24; - unsigned int type: 8; -} mach_msg_type_descriptor_t; diff --git a/libbindgen/tests/headers/blocks.h b/libbindgen/tests/headers/blocks.h deleted file mode 100644 index 80420e6e..00000000 --- a/libbindgen/tests/headers/blocks.h +++ /dev/null @@ -1,3 +0,0 @@ -// bindgen-flags: -- -fblocks - -void atexit_b(void (^)(void)); diff --git a/libbindgen/tests/headers/canonical_path_without_namespacing.hpp b/libbindgen/tests/headers/canonical_path_without_namespacing.hpp deleted file mode 100644 index 92e85842..00000000 --- a/libbindgen/tests/headers/canonical_path_without_namespacing.hpp +++ /dev/null @@ -1,7 +0,0 @@ -// bindgen-flags: --disable-name-namespacing - -namespace foo { - struct Bar {}; -} - -void baz(foo::Bar*); diff --git a/libbindgen/tests/headers/class.hpp b/libbindgen/tests/headers/class.hpp deleted file mode 100644 index e753f186..00000000 --- a/libbindgen/tests/headers/class.hpp +++ /dev/null @@ -1,29 +0,0 @@ -class C { - int a; - // More than rust limits (32) - char big_array[33]; -}; - -class WithDtor { - int b; - - ~WithDtor() {} -}; - -union Union { - float d; - int i; -}; - -class WithUnion { - Union data; -}; - -class RealAbstractionWithTonsOfMethods { - void foo(); -public: - void bar() const; - void bar(); - void bar(int foo); - static void sta(); -}; diff --git a/libbindgen/tests/headers/class_nested.hpp b/libbindgen/tests/headers/class_nested.hpp deleted file mode 100644 index ab38d500..00000000 --- a/libbindgen/tests/headers/class_nested.hpp +++ /dev/null @@ -1,24 +0,0 @@ -class A { -public: - int member_a; - class B { - int member_b; - }; -}; - -A::B var; - -class D { - A::B member; -}; - -template<typename T> -class Templated { - T member; - - class Templated_inner { - public: - T* member_ptr; - void get() {} - }; -}; diff --git a/libbindgen/tests/headers/class_no_members.hpp b/libbindgen/tests/headers/class_no_members.hpp deleted file mode 100644 index a4483558..00000000 --- a/libbindgen/tests/headers/class_no_members.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// bindgen-flags: -- -std=c++11 - -class whatever { -}; - -class whatever_child: public whatever { -}; - -class whatever_child_with_member: public whatever { -public: - int m_member; -}; - -static_assert(sizeof(whatever) == 1, "Testing!"); -static_assert(sizeof(whatever_child) == 1, "Testing!"); -static_assert(sizeof(whatever_child_with_member) == 4, "Testing!"); diff --git a/libbindgen/tests/headers/class_static.hpp b/libbindgen/tests/headers/class_static.hpp deleted file mode 100644 index 21ab2321..00000000 --- a/libbindgen/tests/headers/class_static.hpp +++ /dev/null @@ -1,7 +0,0 @@ -class MyClass { -public: - static const int* example; - static const int* example_check_no_collision; -}; - -static const int* example_check_no_collision; diff --git a/libbindgen/tests/headers/class_static_const.hpp b/libbindgen/tests/headers/class_static_const.hpp deleted file mode 100644 index 150afe8b..00000000 --- a/libbindgen/tests/headers/class_static_const.hpp +++ /dev/null @@ -1,8 +0,0 @@ -using int32_t = int; -typedef unsigned int uint32_t; - -class A { - static const int a = 0; - static const int32_t b = 077; - static const uint32_t c = 0xff; -}; diff --git a/libbindgen/tests/headers/class_use_as.hpp b/libbindgen/tests/headers/class_use_as.hpp deleted file mode 100644 index a4e36ded..00000000 --- a/libbindgen/tests/headers/class_use_as.hpp +++ /dev/null @@ -1,15 +0,0 @@ - -/** - * <div rustbindgen="true" replaces="whatever"></div> - */ -struct whatever_replacement { - int replacement; -}; - -struct whatever { - int b; -}; - -struct container { - whatever c; -}; diff --git a/libbindgen/tests/headers/class_with_dtor.hpp b/libbindgen/tests/headers/class_with_dtor.hpp deleted file mode 100644 index b9bf74e1..00000000 --- a/libbindgen/tests/headers/class_with_dtor.hpp +++ /dev/null @@ -1,13 +0,0 @@ - - -template <typename T> -class HandleWithDtor { - T* ptr; - ~HandleWithDtor() {} -}; - -typedef HandleWithDtor<int> HandleValue; - -class WithoutDtor { - HandleValue shouldBeWithDtor; -}; diff --git a/libbindgen/tests/headers/class_with_inner_struct.hpp b/libbindgen/tests/headers/class_with_inner_struct.hpp deleted file mode 100644 index ec729fe6..00000000 --- a/libbindgen/tests/headers/class_with_inner_struct.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// bindgen-flags: -- -std=c++11 - -class A { - unsigned c; - struct Segment { int begin, end; }; - union { - int f; - } named_union; - union { - int d; - }; -}; - -class B { - unsigned d; - struct Segment { int begin, end; }; -}; - - -enum class StepSyntax { - Keyword, // step-start and step-end - FunctionalWithoutKeyword, // steps(...) - FunctionalWithStartKeyword, // steps(..., start) - FunctionalWithEndKeyword, // steps(..., end) -}; - -class C { - unsigned d; - union { - struct { - float mX1; - float mY1; - float mX2; - float mY2; - } mFunc; - struct { - StepSyntax mStepSyntax; - unsigned int mSteps; - }; - }; - // To ensure it doesn't collide - struct Segment { int begin, end; }; -}; diff --git a/libbindgen/tests/headers/class_with_typedef.hpp b/libbindgen/tests/headers/class_with_typedef.hpp deleted file mode 100644 index 8707cffe..00000000 --- a/libbindgen/tests/headers/class_with_typedef.hpp +++ /dev/null @@ -1,22 +0,0 @@ -typedef int AnotherInt; - -class C { -public: - typedef int MyInt; - typedef const char* Lookup; - MyInt c; - MyInt* ptr; - MyInt arr[10]; - AnotherInt d; - AnotherInt* other_ptr; - - void method(MyInt c); - void methodRef(MyInt& c); - void complexMethodRef(Lookup& c); - void anotherMethod(AnotherInt c); -}; - -class D: public C { -public: - MyInt* ptr; -}; diff --git a/libbindgen/tests/headers/complex.h b/libbindgen/tests/headers/complex.h deleted file mode 100644 index 04877a4e..00000000 --- a/libbindgen/tests/headers/complex.h +++ /dev/null @@ -1,16 +0,0 @@ - -#define COMPLEX_TEST(ty_, name_) \ - struct Test##name_ { \ - ty_ _Complex mMember; \ - \ - }; \ - struct Test##name_##Ptr { \ - ty_ _Complex* mMember; \ - }; - -COMPLEX_TEST(double, Double) -COMPLEX_TEST(float, Float) - -// FIXME: 128-byte-aligned in some machines -// which we can't support right now in Rust. -// COMPLEX_TEST(long double, LongDouble) diff --git a/libbindgen/tests/headers/complex_global.h b/libbindgen/tests/headers/complex_global.h deleted file mode 100644 index d9f9fb01..00000000 --- a/libbindgen/tests/headers/complex_global.h +++ /dev/null @@ -1,3 +0,0 @@ -float _Complex globalValueFloat; -double _Complex globalValueDouble; -long double _Complex globalValueLongDouble; diff --git a/libbindgen/tests/headers/const_bool.hpp b/libbindgen/tests/headers/const_bool.hpp deleted file mode 100644 index 633a7c90..00000000 --- a/libbindgen/tests/headers/const_bool.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// bindgen-unstable - -const bool k = true; -struct A { - static const bool k = false; -}; - -typedef bool foo; -const foo k2 = true; diff --git a/libbindgen/tests/headers/const_enum_unnamed.hpp b/libbindgen/tests/headers/const_enum_unnamed.hpp deleted file mode 100644 index eb139434..00000000 --- a/libbindgen/tests/headers/const_enum_unnamed.hpp +++ /dev/null @@ -1,9 +0,0 @@ - -enum { - FOO_BAR, - FOO_BAZ, -}; - -class Foo { - enum { FOO_BAR = 10 }; -}; diff --git a/libbindgen/tests/headers/const_ptr.hpp b/libbindgen/tests/headers/const_ptr.hpp deleted file mode 100644 index 66744f8b..00000000 --- a/libbindgen/tests/headers/const_ptr.hpp +++ /dev/null @@ -1,3 +0,0 @@ -extern "C" { - void foo(const void* bar); -} diff --git a/libbindgen/tests/headers/const_resolved_ty.h b/libbindgen/tests/headers/const_resolved_ty.h deleted file mode 100644 index 2521e61c..00000000 --- a/libbindgen/tests/headers/const_resolved_ty.h +++ /dev/null @@ -1,3 +0,0 @@ -typedef unsigned char uint8_t; - -void foo(const uint8_t* foo); diff --git a/libbindgen/tests/headers/const_tparam.hpp b/libbindgen/tests/headers/const_tparam.hpp deleted file mode 100644 index 05f26e4a..00000000 --- a/libbindgen/tests/headers/const_tparam.hpp +++ /dev/null @@ -1,5 +0,0 @@ -template<typename T> -class C { - const T* const foo; - const T* bar; -}; diff --git a/libbindgen/tests/headers/constant-evaluate.h b/libbindgen/tests/headers/constant-evaluate.h deleted file mode 100644 index f9f1fa66..00000000 --- a/libbindgen/tests/headers/constant-evaluate.h +++ /dev/null @@ -1,19 +0,0 @@ -// bindgen-unstable - -enum { - foo = 4, - bar = 8, -}; - -typedef unsigned long long EasyToOverflow; -const EasyToOverflow k = 0x80000000; - -const EasyToOverflow k_expr = 1ULL << 60; - -const long long BAZ = (1 << foo) | bar; -const double fuzz = (1 + 50.0f); -const char BAZZ = '5'; -const char WAT = '\0'; - -const char* bytestring = "Foo"; -const char* NOT_UTF8 = "\xf0\x28\x8c\x28"; diff --git a/libbindgen/tests/headers/constify-enum.h b/libbindgen/tests/headers/constify-enum.h deleted file mode 100644 index a5b4052c..00000000 --- a/libbindgen/tests/headers/constify-enum.h +++ /dev/null @@ -1,13 +0,0 @@ - -enum nsCSSPropertyID { - eCSSProperty_a, - eCSSProperty_b, - - eCSSProperty_COUNT, /**< <div rustbindgen constant></div> */ - eCSSProperty_COUNT_DUMMY2 = eCSSProperty_COUNT - 1, /**< <div rustbindgen hide></div> */ - - eCSSPropertyAlias_aa, - eCSSPropertyAlias_bb, - - eCSSProperty_COUNT_unexistingVariantValue, /**< <div rustbindgen constant></div> */ -}; diff --git a/libbindgen/tests/headers/constructor-tp.hpp b/libbindgen/tests/headers/constructor-tp.hpp deleted file mode 100644 index 6e55ea78..00000000 --- a/libbindgen/tests/headers/constructor-tp.hpp +++ /dev/null @@ -1,26 +0,0 @@ - -template<typename T> -class Foo { -public: - Foo(); - - void doBaz(); -}; - -template<typename T> -inline void -Foo<T>::doBaz() { -} - -class Bar { -public: - Bar(); -}; - -template<typename T> -Foo<T>::Foo() { -} - -inline -Bar::Bar() { -} diff --git a/libbindgen/tests/headers/constructors.hpp b/libbindgen/tests/headers/constructors.hpp deleted file mode 100644 index d4174889..00000000 --- a/libbindgen/tests/headers/constructors.hpp +++ /dev/null @@ -1,13 +0,0 @@ - -class TestOverload { - // This one shouldnt' be generated. - TestOverload(); -public: - TestOverload(int); - TestOverload(double); -}; - -class TestPublicNoArgs { -public: - TestPublicNoArgs(); -}; diff --git a/libbindgen/tests/headers/convert-floats.h b/libbindgen/tests/headers/convert-floats.h deleted file mode 100644 index 08d9fe0b..00000000 --- a/libbindgen/tests/headers/convert-floats.h +++ /dev/null @@ -1,9 +0,0 @@ -// bindgen-flags: --no-convert-floats - -struct foo { - float bar, baz; - double bazz; - long double* bazzz; - float _Complex complexFloat; - double _Complex complexDouble; -}; diff --git a/libbindgen/tests/headers/crtp.hpp b/libbindgen/tests/headers/crtp.hpp deleted file mode 100644 index a5477c54..00000000 --- a/libbindgen/tests/headers/crtp.hpp +++ /dev/null @@ -1,12 +0,0 @@ -template<class T> -class Base {}; - -class Derived : public Base<Derived> {}; - -template<class T> -class BaseWithDestructor { - ~BaseWithDestructor(); -}; - -class DerivedFromBaseWithDestructor : - public BaseWithDestructor<DerivedFromBaseWithDestructor> {}; diff --git a/libbindgen/tests/headers/dash_language.h b/libbindgen/tests/headers/dash_language.h deleted file mode 100644 index 4c8bb58d..00000000 --- a/libbindgen/tests/headers/dash_language.h +++ /dev/null @@ -1,6 +0,0 @@ -// bindgen-flags: -- -x c++ --std=c++11 - -template<typename T> -struct Foo { - int bar; -}; diff --git a/libbindgen/tests/headers/decl_extern_int_twice.h b/libbindgen/tests/headers/decl_extern_int_twice.h deleted file mode 100644 index 06f80e87..00000000 --- a/libbindgen/tests/headers/decl_extern_int_twice.h +++ /dev/null @@ -1,2 +0,0 @@ -extern int foo; -extern int foo; diff --git a/libbindgen/tests/headers/decl_ptr_to_array.h b/libbindgen/tests/headers/decl_ptr_to_array.h deleted file mode 100644 index 3222cbd4..00000000 --- a/libbindgen/tests/headers/decl_ptr_to_array.h +++ /dev/null @@ -1 +0,0 @@ -int (*foo)[1]; diff --git a/libbindgen/tests/headers/disable-namespacing.hpp b/libbindgen/tests/headers/disable-namespacing.hpp deleted file mode 100644 index 11191361..00000000 --- a/libbindgen/tests/headers/disable-namespacing.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// bindgen-flags: --disable-name-namespacing - -namespace foo { -namespace bar { - -typedef int Baz; - -} -} diff --git a/libbindgen/tests/headers/duplicated-namespaces-definitions.hpp b/libbindgen/tests/headers/duplicated-namespaces-definitions.hpp deleted file mode 100644 index 7c8888de..00000000 --- a/libbindgen/tests/headers/duplicated-namespaces-definitions.hpp +++ /dev/null @@ -1,18 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces - -namespace foo { - class Bar; -} - -namespace bar { - struct Foo { - foo::Bar* ptr; - }; -}; - -namespace foo { - class Bar { - int foo; - bool baz; - }; -} diff --git a/libbindgen/tests/headers/duplicated-namespaces.hpp b/libbindgen/tests/headers/duplicated-namespaces.hpp deleted file mode 100644 index 10e1933f..00000000 --- a/libbindgen/tests/headers/duplicated-namespaces.hpp +++ /dev/null @@ -1,4 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces - -namespace std {} -namespace std {} diff --git a/libbindgen/tests/headers/duplicated_constants_in_ns.hpp b/libbindgen/tests/headers/duplicated_constants_in_ns.hpp deleted file mode 100644 index bb343641..00000000 --- a/libbindgen/tests/headers/duplicated_constants_in_ns.hpp +++ /dev/null @@ -1,7 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces -namespace foo { - const int FOO = 4; -} -namespace bar { - const int FOO = 5; -} diff --git a/libbindgen/tests/headers/elaborated.hpp b/libbindgen/tests/headers/elaborated.hpp deleted file mode 100644 index 4bfbff23..00000000 --- a/libbindgen/tests/headers/elaborated.hpp +++ /dev/null @@ -1,5 +0,0 @@ -namespace whatever { - typedef int whatever_t; -} - -void something(const whatever::whatever_t *wat); diff --git a/libbindgen/tests/headers/empty_template_param_name.hpp b/libbindgen/tests/headers/empty_template_param_name.hpp deleted file mode 100644 index 0e9f3c34..00000000 --- a/libbindgen/tests/headers/empty_template_param_name.hpp +++ /dev/null @@ -1,6 +0,0 @@ -// bindgen-flags: -- -std=c++11 - -template<typename...> using __void_t = void; - -template<typename _Iterator, typename = __void_t<>> - struct __iterator_traits { }; diff --git a/libbindgen/tests/headers/enum.h b/libbindgen/tests/headers/enum.h deleted file mode 100644 index f2d301e7..00000000 --- a/libbindgen/tests/headers/enum.h +++ /dev/null @@ -1,9 +0,0 @@ -enum Foo { - Bar = 0, - Qux -}; - -enum Neg { - MinusOne = -1, - One = 1, -}; diff --git a/libbindgen/tests/headers/enum_alias.hpp b/libbindgen/tests/headers/enum_alias.hpp deleted file mode 100644 index 658f8fde..00000000 --- a/libbindgen/tests/headers/enum_alias.hpp +++ /dev/null @@ -1,7 +0,0 @@ -// bindgen-flags: -- -std=c++11 - -typedef unsigned char uint8_t; - -enum Bar : uint8_t { - VAL -}; diff --git a/libbindgen/tests/headers/enum_and_vtable_mangling.hpp b/libbindgen/tests/headers/enum_and_vtable_mangling.hpp deleted file mode 100644 index 3abd6a29..00000000 --- a/libbindgen/tests/headers/enum_and_vtable_mangling.hpp +++ /dev/null @@ -1,11 +0,0 @@ - -enum { - match, - whatever_else, -}; - -class C { - int i; -public: - virtual void match() { }; -}; diff --git a/libbindgen/tests/headers/enum_dupe.h b/libbindgen/tests/headers/enum_dupe.h deleted file mode 100644 index 6d3591d5..00000000 --- a/libbindgen/tests/headers/enum_dupe.h +++ /dev/null @@ -1,4 +0,0 @@ -enum Foo { - Bar = 1, - Dupe = 1 -}; diff --git a/libbindgen/tests/headers/enum_explicit_type.hpp b/libbindgen/tests/headers/enum_explicit_type.hpp deleted file mode 100644 index 78eadd40..00000000 --- a/libbindgen/tests/headers/enum_explicit_type.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// bindgen-flags: -- -std=c++11 - -enum Foo: unsigned char { - Bar = 0, - Qux -}; - -enum Neg: char { - MinusOne = -1, - One = 1, -}; - -enum Bigger: unsigned short { - Much = 255, - Larger -}; - -enum MuchLong: long { - MuchLow = -4294967296, -}; - -enum MuchLongLong: long long { - I64_MIN = 1ll << 63, -}; - -enum MuchULongLong: unsigned long long { - MuchHigh = 4294967296, -}; diff --git a/libbindgen/tests/headers/enum_in_template_with_typedef.hpp b/libbindgen/tests/headers/enum_in_template_with_typedef.hpp deleted file mode 100644 index ac19b781..00000000 --- a/libbindgen/tests/headers/enum_in_template_with_typedef.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// bindgen-flags: -- -std=c++11 - -namespace std { - template <typename Char> class fbstring_core; -} - -typedef unsigned char uint8_t; -namespace std { - template <typename Char> class fbstring_core { - typedef uint8_t category_type; - enum Category : category_type { - Foo = 1, - Bar = 4, - }; - }; -} diff --git a/libbindgen/tests/headers/enum_negative.h b/libbindgen/tests/headers/enum_negative.h deleted file mode 100644 index 6cbdfe04..00000000 --- a/libbindgen/tests/headers/enum_negative.h +++ /dev/null @@ -1,4 +0,0 @@ -enum Foo { - Bar = -2, - Qux = 1, -}; diff --git a/libbindgen/tests/headers/enum_packed.h b/libbindgen/tests/headers/enum_packed.h deleted file mode 100644 index 8654d110..00000000 --- a/libbindgen/tests/headers/enum_packed.h +++ /dev/null @@ -1,14 +0,0 @@ -enum __attribute__((packed)) Foo { - Bar = 0, - Qux -}; - -enum __attribute__((packed)) Neg { - MinusOne = -1, - One = 1, -}; - -enum __attribute__((packed)) Bigger { - Much = 255, - Larger -}; diff --git a/libbindgen/tests/headers/eval-variadic-template-parameter.hpp b/libbindgen/tests/headers/eval-variadic-template-parameter.hpp deleted file mode 100644 index 0a9e51c1..00000000 --- a/libbindgen/tests/headers/eval-variadic-template-parameter.hpp +++ /dev/null @@ -1,8 +0,0 @@ -// bindgen-flags: -- -std=c++11 - -template <typename... T> -struct B { - // Can't generate anything meaningful in Rust for this, but we shouldn't - // trigger an assertion inside Clang. - static const long c = sizeof...(T); -}; diff --git a/libbindgen/tests/headers/extern.hpp b/libbindgen/tests/headers/extern.hpp deleted file mode 100644 index 0779e038..00000000 --- a/libbindgen/tests/headers/extern.hpp +++ /dev/null @@ -1,3 +0,0 @@ -extern "C" { -#include "func_proto.h" -} diff --git a/libbindgen/tests/headers/float128.hpp b/libbindgen/tests/headers/float128.hpp deleted file mode 100644 index f554e88e..00000000 --- a/libbindgen/tests/headers/float128.hpp +++ /dev/null @@ -1,13 +0,0 @@ -// FIXME: libclang < 3.9 does not expose `__float128` in its interface, so this -// test will fail. Once we remove support for `--features llvm_stable` and -// require libclang >= 3.9, we can reenable this test. -// -// static __float128 global = 1.0; - -// FIXME: We have no way to get 128 bit aligned structs in Rust at the moment, -// and therefore the generated layout tests for this struct will fail. When we -// can enforce 128 bit alignment, we can re-enable this test. -// -// struct A { -// __float128 f; -// }; diff --git a/libbindgen/tests/headers/forward-inherit-struct-with-fields.hpp b/libbindgen/tests/headers/forward-inherit-struct-with-fields.hpp deleted file mode 100644 index 437fff5d..00000000 --- a/libbindgen/tests/headers/forward-inherit-struct-with-fields.hpp +++ /dev/null @@ -1,8 +0,0 @@ -template <typename> class Rooted; -namespace js { - template <typename T> class RootedBase { - T* foo; - Rooted<T>* next; - }; -} -template <typename T> class Rooted : js::RootedBase<T> {}; diff --git a/libbindgen/tests/headers/forward-inherit-struct.hpp b/libbindgen/tests/headers/forward-inherit-struct.hpp deleted file mode 100644 index ac7aef5e..00000000 --- a/libbindgen/tests/headers/forward-inherit-struct.hpp +++ /dev/null @@ -1,5 +0,0 @@ -template <typename> class Rooted; -namespace js { - template <typename T> class RootedBase {}; -} -template <typename T> class Rooted : js::RootedBase<T> {}; diff --git a/libbindgen/tests/headers/forward_declared_struct.h b/libbindgen/tests/headers/forward_declared_struct.h deleted file mode 100644 index 2a69450c..00000000 --- a/libbindgen/tests/headers/forward_declared_struct.h +++ /dev/null @@ -1,11 +0,0 @@ -struct a; - -struct a { - int b; -}; - -struct c { - int d; -}; - -struct c;
\ No newline at end of file diff --git a/libbindgen/tests/headers/func_proto.h b/libbindgen/tests/headers/func_proto.h deleted file mode 100644 index 51139ca9..00000000 --- a/libbindgen/tests/headers/func_proto.h +++ /dev/null @@ -1 +0,0 @@ -typedef int foo(int bar); diff --git a/libbindgen/tests/headers/func_ptr.h b/libbindgen/tests/headers/func_ptr.h deleted file mode 100644 index a4662f3d..00000000 --- a/libbindgen/tests/headers/func_ptr.h +++ /dev/null @@ -1 +0,0 @@ -int (*foo) (int x, int y); diff --git a/libbindgen/tests/headers/func_ptr_in_struct.h b/libbindgen/tests/headers/func_ptr_in_struct.h deleted file mode 100644 index 988db5b3..00000000 --- a/libbindgen/tests/headers/func_ptr_in_struct.h +++ /dev/null @@ -1,6 +0,0 @@ - -enum baz; - -struct Foo { - enum baz (*bar) (int x, int y); -}; diff --git a/libbindgen/tests/headers/func_with_array_arg.h b/libbindgen/tests/headers/func_with_array_arg.h deleted file mode 100644 index 1b81702b..00000000 --- a/libbindgen/tests/headers/func_with_array_arg.h +++ /dev/null @@ -1 +0,0 @@ -void f(int x[2]); diff --git a/libbindgen/tests/headers/func_with_func_ptr_arg.h b/libbindgen/tests/headers/func_with_func_ptr_arg.h deleted file mode 100644 index 629c84ab..00000000 --- a/libbindgen/tests/headers/func_with_func_ptr_arg.h +++ /dev/null @@ -1 +0,0 @@ -void foo(void (*bar)()); diff --git a/libbindgen/tests/headers/in_class_typedef.hpp b/libbindgen/tests/headers/in_class_typedef.hpp deleted file mode 100644 index dda7472d..00000000 --- a/libbindgen/tests/headers/in_class_typedef.hpp +++ /dev/null @@ -1,10 +0,0 @@ - -template<typename T> -class Foo { - typedef T elem_type; - typedef T* ptr_type; - - typedef struct Bar { - int x, y; - } Bar; -}; diff --git a/libbindgen/tests/headers/inherit-namespaced.hpp b/libbindgen/tests/headers/inherit-namespaced.hpp deleted file mode 100644 index 61eafd5a..00000000 --- a/libbindgen/tests/headers/inherit-namespaced.hpp +++ /dev/null @@ -1,4 +0,0 @@ -namespace js { - template <typename T> class RootedBase {}; -} -template <typename T> class Rooted : js::RootedBase<T> {}; diff --git a/libbindgen/tests/headers/inherit_named.hpp b/libbindgen/tests/headers/inherit_named.hpp deleted file mode 100644 index 9881d1b6..00000000 --- a/libbindgen/tests/headers/inherit_named.hpp +++ /dev/null @@ -1,5 +0,0 @@ -template<typename T> -class Wohoo {}; - -template<typename T> -class Weeee : public T {}; diff --git a/libbindgen/tests/headers/inherit_typedef.hpp b/libbindgen/tests/headers/inherit_typedef.hpp deleted file mode 100644 index 8d699e82..00000000 --- a/libbindgen/tests/headers/inherit_typedef.hpp +++ /dev/null @@ -1,5 +0,0 @@ -struct Foo {}; - -typedef Foo TypedefedFoo; - -struct Bar: public TypedefedFoo {}; diff --git a/libbindgen/tests/headers/inline-function.h b/libbindgen/tests/headers/inline-function.h deleted file mode 100644 index 02cb7c08..00000000 --- a/libbindgen/tests/headers/inline-function.h +++ /dev/null @@ -1,6 +0,0 @@ -// bindgen-unstable - -/** The point of this test is to _not_ generate these functions. */ - -inline static int myadd(const int x, const int y) { return x + y; } -static int mysub(const int x, const int y) { return x - y; } diff --git a/libbindgen/tests/headers/inline_namespace.hpp b/libbindgen/tests/headers/inline_namespace.hpp deleted file mode 100644 index 2ccf8ab0..00000000 --- a/libbindgen/tests/headers/inline_namespace.hpp +++ /dev/null @@ -1,11 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces -- -std=c++11 - -namespace foo { - inline namespace bar { - using Ty = int; - }; -}; - -class Bar { - foo::Ty baz; -}; diff --git a/libbindgen/tests/headers/inline_namespace_conservative.hpp b/libbindgen/tests/headers/inline_namespace_conservative.hpp deleted file mode 100644 index 50068a2e..00000000 --- a/libbindgen/tests/headers/inline_namespace_conservative.hpp +++ /dev/null @@ -1,12 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces --conservative-inline-namespaces -- -std=c++11 - -namespace foo { - inline namespace bar { - using Ty = int; - }; - using Ty = long long; -}; - -class Bar { - foo::bar::Ty baz; -}; diff --git a/libbindgen/tests/headers/inline_namespace_whitelist.hpp b/libbindgen/tests/headers/inline_namespace_whitelist.hpp deleted file mode 100644 index 30047bbe..00000000 --- a/libbindgen/tests/headers/inline_namespace_whitelist.hpp +++ /dev/null @@ -1,7 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces --whitelist-type=std::string -- -std=c++11 - -namespace std { - inline namespace bar { - using string = const char*; - }; -}; diff --git a/libbindgen/tests/headers/inner_const.hpp b/libbindgen/tests/headers/inner_const.hpp deleted file mode 100644 index 25c2e603..00000000 --- a/libbindgen/tests/headers/inner_const.hpp +++ /dev/null @@ -1,6 +0,0 @@ - -class Foo { - static int BOO; - static Foo whatever; - int bar; -}; diff --git a/libbindgen/tests/headers/inner_template_self.hpp b/libbindgen/tests/headers/inner_template_self.hpp deleted file mode 100644 index 1ae5af06..00000000 --- a/libbindgen/tests/headers/inner_template_self.hpp +++ /dev/null @@ -1,10 +0,0 @@ - -template <typename T> -class LinkedList { - LinkedList<T>* next; - LinkedList* prev; -}; - -class InstantiateIt { - LinkedList<int> m_list; -}; diff --git a/libbindgen/tests/headers/int128_t.h b/libbindgen/tests/headers/int128_t.h deleted file mode 100644 index eece252c..00000000 --- a/libbindgen/tests/headers/int128_t.h +++ /dev/null @@ -1,7 +0,0 @@ -/** - * FIXME: Uncomment this once we can generate the proper alignment for the type, - * i.e., when we use u128/i128. -struct Foo { - __int128 foo; -}; - */ diff --git a/libbindgen/tests/headers/issue-358.hpp b/libbindgen/tests/headers/issue-358.hpp deleted file mode 100644 index b14521b7..00000000 --- a/libbindgen/tests/headers/issue-358.hpp +++ /dev/null @@ -1,8 +0,0 @@ -// bindgen-flags: -- -std=c++11 -namespace JS { -template <typename> class PersistentRooted; -} -template <typename> class a { a *b; }; -namespace JS { -template <typename c> class PersistentRooted : a<PersistentRooted<c>> {}; -} diff --git a/libbindgen/tests/headers/issue-372.hpp b/libbindgen/tests/headers/issue-372.hpp deleted file mode 100644 index a072f061..00000000 --- a/libbindgen/tests/headers/issue-372.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces -template <typename a, int b> class c { a e[b]; }; -class d; -template <typename g, g f> class C { c<d, f> h; }; -class i { - i *j; - i *k; - bool l; -}; -class d { - i m; -}; -enum n { o, p, q, r, s, t, b, ae, e, ag, ah, ai }; -class F { - C<n, ai> w; -}; diff --git a/libbindgen/tests/headers/issue_311.hpp b/libbindgen/tests/headers/issue_311.hpp deleted file mode 100644 index a8d7fd99..00000000 --- a/libbindgen/tests/headers/issue_311.hpp +++ /dev/null @@ -1,5 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces - -struct jsval_layout { - struct {}; -}; diff --git a/libbindgen/tests/headers/issue_315.hpp b/libbindgen/tests/headers/issue_315.hpp deleted file mode 100644 index e58cb5e3..00000000 --- a/libbindgen/tests/headers/issue_315.hpp +++ /dev/null @@ -1,2 +0,0 @@ -/// <div rustbindgen replaces="c"></div> -template <typename a> using b = a; diff --git a/libbindgen/tests/headers/jsval_layout_opaque.hpp b/libbindgen/tests/headers/jsval_layout_opaque.hpp deleted file mode 100644 index 85c5be63..00000000 --- a/libbindgen/tests/headers/jsval_layout_opaque.hpp +++ /dev/null @@ -1,424 +0,0 @@ -// bindgen-flags: --no-unstable-rust -- -std=c++11 - -/** - * These typedefs are hacky, but keep our tests consistent across 64-bit - * platforms, otherwise the id's change and our CI is unhappy. - */ -typedef unsigned char uint8_t; -typedef int int32_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; -typedef unsigned long long size_t; -typedef unsigned long long uintptr_t; - - -#define JS_PUNBOX64 -#define IS_LITTLE_ENDIAN - -/* - * Try to get jsvals 64-bit aligned. We could almost assert that all values are - * aligned, but MSVC and GCC occasionally break alignment. - */ -#if defined(__GNUC__) || defined(__xlc__) || defined(__xlC__) -# define JSVAL_ALIGNMENT __attribute__((aligned (8))) -#elif defined(_MSC_VER) - /* - * Structs can be aligned with MSVC, but not if they are used as parameters, - * so we just don't try to align. - */ -# define JSVAL_ALIGNMENT -#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) -# define JSVAL_ALIGNMENT -#elif defined(__HP_cc) || defined(__HP_aCC) -# define JSVAL_ALIGNMENT -#endif - -#if defined(JS_PUNBOX64) -# define JSVAL_TAG_SHIFT 47 -#endif - -/* - * We try to use enums so that printing a jsval_layout in the debugger shows - * nice symbolic type tags, however we can only do this when we can force the - * underlying type of the enum to be the desired size. - */ -#if !defined(__SUNPRO_CC) && !defined(__xlC__) - -#if defined(_MSC_VER) -# define JS_ENUM_HEADER(id, type) enum id : type -# define JS_ENUM_FOOTER(id) -#else -# define JS_ENUM_HEADER(id, type) enum id -# define JS_ENUM_FOOTER(id) __attribute__((packed)) -#endif - -/* Remember to propagate changes to the C defines below. */ -JS_ENUM_HEADER(JSValueType, uint8_t) -{ - JSVAL_TYPE_DOUBLE = 0x00, - JSVAL_TYPE_INT32 = 0x01, - JSVAL_TYPE_UNDEFINED = 0x02, - JSVAL_TYPE_BOOLEAN = 0x03, - JSVAL_TYPE_MAGIC = 0x04, - JSVAL_TYPE_STRING = 0x05, - JSVAL_TYPE_SYMBOL = 0x06, - JSVAL_TYPE_NULL = 0x07, - JSVAL_TYPE_OBJECT = 0x08, - - /* These never appear in a jsval; they are only provided as an out-of-band value. */ - JSVAL_TYPE_UNKNOWN = 0x20, - JSVAL_TYPE_MISSING = 0x21 -} JS_ENUM_FOOTER(JSValueType); - -static_assert(sizeof(JSValueType) == 1, - "compiler typed enum support is apparently buggy"); - -#if defined(JS_NUNBOX32) - -/* Remember to propagate changes to the C defines below. */ -JS_ENUM_HEADER(JSValueTag, uint32_t) -{ - JSVAL_TAG_CLEAR = 0xFFFFFF80, - JSVAL_TAG_INT32 = JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32, - JSVAL_TAG_UNDEFINED = JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED, - JSVAL_TAG_STRING = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING, - JSVAL_TAG_SYMBOL = JSVAL_TAG_CLEAR | JSVAL_TYPE_SYMBOL, - JSVAL_TAG_BOOLEAN = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN, - JSVAL_TAG_MAGIC = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC, - JSVAL_TAG_NULL = JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL, - JSVAL_TAG_OBJECT = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT -} JS_ENUM_FOOTER(JSValueTag); - -static_assert(sizeof(JSValueTag) == sizeof(uint32_t), - "compiler typed enum support is apparently buggy"); - -#elif defined(JS_PUNBOX64) - -/* Remember to propagate changes to the C defines below. */ -JS_ENUM_HEADER(JSValueTag, uint32_t) -{ - JSVAL_TAG_MAX_DOUBLE = 0x1FFF0, - JSVAL_TAG_INT32 = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32, - JSVAL_TAG_UNDEFINED = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED, - JSVAL_TAG_STRING = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING, - JSVAL_TAG_SYMBOL = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_SYMBOL, - JSVAL_TAG_BOOLEAN = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN, - JSVAL_TAG_MAGIC = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC, - JSVAL_TAG_NULL = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL, - JSVAL_TAG_OBJECT = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT -} JS_ENUM_FOOTER(JSValueTag); - -static_assert(sizeof(JSValueTag) == sizeof(uint32_t), - "compiler typed enum support is apparently buggy"); - -JS_ENUM_HEADER(JSValueShiftedTag, uint64_t) -{ - JSVAL_SHIFTED_TAG_MAX_DOUBLE = ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF), - JSVAL_SHIFTED_TAG_INT32 = (((uint64_t)JSVAL_TAG_INT32) << JSVAL_TAG_SHIFT), - JSVAL_SHIFTED_TAG_UNDEFINED = (((uint64_t)JSVAL_TAG_UNDEFINED) << JSVAL_TAG_SHIFT), - JSVAL_SHIFTED_TAG_STRING = (((uint64_t)JSVAL_TAG_STRING) << JSVAL_TAG_SHIFT), - JSVAL_SHIFTED_TAG_SYMBOL = (((uint64_t)JSVAL_TAG_SYMBOL) << JSVAL_TAG_SHIFT), - JSVAL_SHIFTED_TAG_BOOLEAN = (((uint64_t)JSVAL_TAG_BOOLEAN) << JSVAL_TAG_SHIFT), - JSVAL_SHIFTED_TAG_MAGIC = (((uint64_t)JSVAL_TAG_MAGIC) << JSVAL_TAG_SHIFT), - JSVAL_SHIFTED_TAG_NULL = (((uint64_t)JSVAL_TAG_NULL) << JSVAL_TAG_SHIFT), - JSVAL_SHIFTED_TAG_OBJECT = (((uint64_t)JSVAL_TAG_OBJECT) << JSVAL_TAG_SHIFT) -} JS_ENUM_FOOTER(JSValueShiftedTag); - -static_assert(sizeof(JSValueShiftedTag) == sizeof(uint64_t), - "compiler typed enum support is apparently buggy"); - -#endif - -/* - * All our supported compilers implement C++11 |enum Foo : T| syntax, so don't - * expose these macros. (This macro exists *only* because gcc bug 51242 - * <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51242> makes bit-fields of - * typed enums trigger a warning that can't be turned off. Don't expose it - * beyond this file!) - */ -#undef JS_ENUM_HEADER -#undef JS_ENUM_FOOTER - -#else /* !defined(__SUNPRO_CC) && !defined(__xlC__) */ - -typedef uint8_t JSValueType; -#define JSVAL_TYPE_DOUBLE ((uint8_t)0x00) -#define JSVAL_TYPE_INT32 ((uint8_t)0x01) -#define JSVAL_TYPE_UNDEFINED ((uint8_t)0x02) -#define JSVAL_TYPE_BOOLEAN ((uint8_t)0x03) -#define JSVAL_TYPE_MAGIC ((uint8_t)0x04) -#define JSVAL_TYPE_STRING ((uint8_t)0x05) -#define JSVAL_TYPE_SYMBOL ((uint8_t)0x06) -#define JSVAL_TYPE_NULL ((uint8_t)0x07) -#define JSVAL_TYPE_OBJECT ((uint8_t)0x08) -#define JSVAL_TYPE_UNKNOWN ((uint8_t)0x20) - -#if defined(JS_NUNBOX32) - -typedef uint32_t JSValueTag; -#define JSVAL_TAG_CLEAR ((uint32_t)(0xFFFFFF80)) -#define JSVAL_TAG_INT32 ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32)) -#define JSVAL_TAG_UNDEFINED ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED)) -#define JSVAL_TAG_STRING ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING)) -#define JSVAL_TAG_SYMBOL ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_SYMBOL)) -#define JSVAL_TAG_BOOLEAN ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN)) -#define JSVAL_TAG_MAGIC ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC)) -#define JSVAL_TAG_NULL ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL)) -#define JSVAL_TAG_OBJECT ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT)) - -#elif defined(JS_PUNBOX64) - -typedef uint32_t JSValueTag; -#define JSVAL_TAG_MAX_DOUBLE ((uint32_t)(0x1FFF0)) -#define JSVAL_TAG_INT32 (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32) -#define JSVAL_TAG_UNDEFINED (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED) -#define JSVAL_TAG_STRING (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING) -#define JSVAL_TAG_SYMBOL (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_SYMBOL) -#define JSVAL_TAG_BOOLEAN (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN) -#define JSVAL_TAG_MAGIC (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC) -#define JSVAL_TAG_NULL (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL) -#define JSVAL_TAG_OBJECT (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT) - -typedef uint64_t JSValueShiftedTag; -#define JSVAL_SHIFTED_TAG_MAX_DOUBLE ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF) -#define JSVAL_SHIFTED_TAG_INT32 (((uint64_t)JSVAL_TAG_INT32) << JSVAL_TAG_SHIFT) -#define JSVAL_SHIFTED_TAG_UNDEFINED (((uint64_t)JSVAL_TAG_UNDEFINED) << JSVAL_TAG_SHIFT) -#define JSVAL_SHIFTED_TAG_STRING (((uint64_t)JSVAL_TAG_STRING) << JSVAL_TAG_SHIFT) -#define JSVAL_SHIFTED_TAG_SYMBOL (((uint64_t)JSVAL_TAG_SYMBOL) << JSVAL_TAG_SHIFT) -#define JSVAL_SHIFTED_TAG_BOOLEAN (((uint64_t)JSVAL_TAG_BOOLEAN) << JSVAL_TAG_SHIFT) -#define JSVAL_SHIFTED_TAG_MAGIC (((uint64_t)JSVAL_TAG_MAGIC) << JSVAL_TAG_SHIFT) -#define JSVAL_SHIFTED_TAG_NULL (((uint64_t)JSVAL_TAG_NULL) << JSVAL_TAG_SHIFT) -#define JSVAL_SHIFTED_TAG_OBJECT (((uint64_t)JSVAL_TAG_OBJECT) << JSVAL_TAG_SHIFT) - -#endif /* JS_PUNBOX64 */ -#endif /* !defined(__SUNPRO_CC) && !defined(__xlC__) */ - -#if defined(JS_NUNBOX32) - -#define JSVAL_TYPE_TO_TAG(type) ((JSValueTag)(JSVAL_TAG_CLEAR | (type))) - -#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET JSVAL_TAG_NULL -#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET JSVAL_TAG_OBJECT -#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET JSVAL_TAG_INT32 -#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET JSVAL_TAG_STRING - -#elif defined(JS_PUNBOX64) - -#define JSVAL_PAYLOAD_MASK 0x00007FFFFFFFFFFFLL -#define JSVAL_TAG_MASK 0xFFFF800000000000LL -#define JSVAL_TYPE_TO_TAG(type) ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type))) -#define JSVAL_TYPE_TO_SHIFTED_TAG(type) (((uint64_t)JSVAL_TYPE_TO_TAG(type)) << JSVAL_TAG_SHIFT) - -#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET JSVAL_TAG_NULL -#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET JSVAL_TAG_OBJECT -#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET JSVAL_TAG_INT32 -#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET JSVAL_TAG_STRING - -#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET JSVAL_SHIFTED_TAG_NULL -#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET JSVAL_SHIFTED_TAG_OBJECT -#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET JSVAL_SHIFTED_TAG_UNDEFINED -#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET JSVAL_SHIFTED_TAG_STRING - -#endif /* JS_PUNBOX64 */ - -typedef enum JSWhyMagic -{ - /** a hole in a native object's elements */ - JS_ELEMENTS_HOLE, - - /** there is not a pending iterator value */ - JS_NO_ITER_VALUE, - - /** exception value thrown when closing a generator */ - JS_GENERATOR_CLOSING, - - /** compiler sentinel value */ - JS_NO_CONSTANT, - - /** used in debug builds to catch tracing errors */ - JS_THIS_POISON, - - /** used in debug builds to catch tracing errors */ - JS_ARG_POISON, - - /** an empty subnode in the AST serializer */ - JS_SERIALIZE_NO_NODE, - - /** lazy arguments value on the stack */ - JS_LAZY_ARGUMENTS, - - /** optimized-away 'arguments' value */ - JS_OPTIMIZED_ARGUMENTS, - - /** magic value passed to natives to indicate construction */ - JS_IS_CONSTRUCTING, - - /** arguments.callee has been overwritten */ - JS_OVERWRITTEN_CALLEE, - - /** value of static block object slot */ - JS_BLOCK_NEEDS_CLONE, - - /** see class js::HashableValue */ - JS_HASH_KEY_EMPTY, - - /** error while running Ion code */ - JS_ION_ERROR, - - /** missing recover instruction result */ - JS_ION_BAILOUT, - - /** optimized out slot */ - JS_OPTIMIZED_OUT, - - /** uninitialized lexical bindings that produce ReferenceError on touch. */ - JS_UNINITIALIZED_LEXICAL, - - /** for local use */ - JS_GENERIC_MAGIC, - - JS_WHY_MAGIC_COUNT -} JSWhyMagic; - -#if defined(IS_LITTLE_ENDIAN) -# if defined(JS_NUNBOX32) -typedef union jsval_layout -{ - uint64_t asBits; - struct { - union { - int32_t i32; - uint32_t u32; - uint32_t boo; // Don't use |bool| -- it must be four bytes. - JSString* str; - JS::Symbol* sym; - JSObject* obj; - js::gc::Cell* cell; - void* ptr; - JSWhyMagic why; - size_t word; - uintptr_t uintptr; - } payload; - JSValueTag tag; - } s; - double asDouble; - void* asPtr; -} JSVAL_ALIGNMENT jsval_layout; -# elif defined(JS_PUNBOX64) -typedef union jsval_layout -{ - uint64_t asBits; -#if !defined(_WIN64) - /* MSVC does not pack these correctly :-( */ - struct { - uint64_t payload47 : 47; - JSValueTag tag : 17; - } debugView; -#endif - struct { - union { - int32_t i32; - uint32_t u32; - JSWhyMagic why; - } payload; - } s; - double asDouble; - void* asPtr; - size_t asWord; - uintptr_t asUIntPtr; -} JSVAL_ALIGNMENT jsval_layout; -# endif /* JS_PUNBOX64 */ -#else /* defined(IS_LITTLE_ENDIAN) */ -# if defined(JS_NUNBOX32) -typedef union jsval_layout -{ - uint64_t asBits; - struct { - JSValueTag tag; - union { - int32_t i32; - uint32_t u32; - uint32_t boo; // Don't use |bool| -- it must be four bytes. - JSString* str; - JS::Symbol* sym; - JSObject* obj; - js::gc::Cell* cell; - void* ptr; - JSWhyMagic why; - size_t word; - uintptr_t uintptr; - } payload; - } s; - double asDouble; - void* asPtr; -} JSVAL_ALIGNMENT jsval_layout; -# elif defined(JS_PUNBOX64) -typedef union jsval_layout -{ - uint64_t asBits; - struct { - JSValueTag tag : 17; - uint64_t payload47 : 47; - } debugView; - struct { - uint32_t padding; - union { - int32_t i32; - uint32_t u32; - JSWhyMagic why; - } payload; - } s; - double asDouble; - void* asPtr; - size_t asWord; - uintptr_t asUIntPtr; -} JSVAL_ALIGNMENT jsval_layout; -# endif /* JS_PUNBOX64 */ -#endif /* defined(IS_LITTLE_ENDIAN) */ - -/* - * For codesize purposes on some platforms, it's important that the - * compiler know that JS::Values constructed from constant values can be - * folded to constant bit patterns at compile time, rather than - * constructed at runtime. Doing this requires a fair amount of C++11 - * features, which are not supported on all of our compilers. Set up - * some defines and helper macros in an attempt to confine the ugliness - * here, rather than scattering it all about the file. The important - * features are: - * - * - constexpr; - * - defaulted functions; - * - C99-style designated initializers. - */ -#if defined(__clang__) -# if __has_feature(cxx_constexpr) && __has_feature(cxx_defaulted_functions) -# define JS_VALUE_IS_CONSTEXPR -# endif -#elif defined(__GNUC__) -/* - * We need 4.5 for defaulted functions, 4.6 for constexpr, 4.7 because 4.6 - * doesn't understand |(X) { .field = ... }| syntax, and 4.7.3 because - * versions prior to that have bugs in the C++ front-end that cause crashes. - */ -# if MOZ_GCC_VERSION_AT_LEAST(4, 7, 3) -# define JS_VALUE_IS_CONSTEXPR -# endif -#endif - -#if defined(JS_VALUE_IS_CONSTEXPR) -# define JS_RETURN_LAYOUT_FROM_BITS(BITS) \ - return (jsval_layout) { .asBits = (BITS) } -# define JS_VALUE_CONSTEXPR MOZ_CONSTEXPR -# define JS_VALUE_CONSTEXPR_VAR MOZ_CONSTEXPR_VAR -#else -# define JS_RETURN_LAYOUT_FROM_BITS(BITS) \ - jsval_layout l; \ - l.asBits = (BITS); \ - return l; -# define JS_VALUE_CONSTEXPR -# define JS_VALUE_CONSTEXPR_VAR const -#endif - -struct Value { - jsval_layout data; -}; diff --git a/libbindgen/tests/headers/keywords.h b/libbindgen/tests/headers/keywords.h deleted file mode 100644 index 8699ce5f..00000000 --- a/libbindgen/tests/headers/keywords.h +++ /dev/null @@ -1,49 +0,0 @@ -int u8; -int u16; -int u32; -int u64; -int i8; -int i16; -int i32; -int i64; -int f32; -int f64; -int usize; -int isize; -int as; -int box; -int crate; -int false; -int fn; -int impl; -int in; -int let; -int loop; -int match; -int mod; -int move; -int mut; -int pub; -int ref; -int self; -int Self; -int super; -int trait; -int true; -int type; -int unsafe; -int use; -int where; -int abstract; -int alignof; -int become; -int final; -int macro; -int offsetof; -int override; -int priv; -int proc; -int pure; -int unsized; -int virtual; -int yield; diff --git a/libbindgen/tests/headers/macro-expr-basic.h b/libbindgen/tests/headers/macro-expr-basic.h deleted file mode 100644 index d2de7fdf..00000000 --- a/libbindgen/tests/headers/macro-expr-basic.h +++ /dev/null @@ -1,14 +0,0 @@ -#define FOO 1 -#define BAR 4 -#define BAZ (FOO + BAR) - -#define MIN (1 << 63) - -#define BARR (1 << 0) -#define BAZZ ((1 << 1) + BAZ) -#define I_RAN_OUT_OF_DUMB_NAMES (BARR | BAZZ) - -/* I haz a comment */ -#define HAZ_A_COMMENT BARR - -#define HAZ_A_COMMENT_INSIDE (/* comment for real */ BARR + FOO) diff --git a/libbindgen/tests/headers/macro-redef.h b/libbindgen/tests/headers/macro-redef.h deleted file mode 100644 index 0180d2ab..00000000 --- a/libbindgen/tests/headers/macro-redef.h +++ /dev/null @@ -1,5 +0,0 @@ -#define FOO 4 -#define BAR (1 + FOO) -#undef FOO -#define FOO 5 -#define BAZ (1 + FOO) diff --git a/libbindgen/tests/headers/macro_const.h b/libbindgen/tests/headers/macro_const.h deleted file mode 100644 index c28a3f6b..00000000 --- a/libbindgen/tests/headers/macro_const.h +++ /dev/null @@ -1,7 +0,0 @@ -#define foo "bar" -#define CHAR 'b' -#define CHARR '\0' -#define FLOAT 5.09f -#define FLOAT_EXPR (5 / 1000.0f) - -#define INVALID_UTF8 "\xf0\x28\x8c\x28" diff --git a/libbindgen/tests/headers/maddness-is-avoidable.hpp b/libbindgen/tests/headers/maddness-is-avoidable.hpp deleted file mode 100644 index 46d7495e..00000000 --- a/libbindgen/tests/headers/maddness-is-avoidable.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// bindgen-flags: --blacklist-type RefPtr_Proxy_member_function - -template<typename T> -class RefPtr { - template<typename R, typename... Args> - class Proxy { - typedef R (T::*member_function)(Args...); - }; -}; diff --git a/libbindgen/tests/headers/method-mangling.hpp b/libbindgen/tests/headers/method-mangling.hpp deleted file mode 100644 index 0dac4975..00000000 --- a/libbindgen/tests/headers/method-mangling.hpp +++ /dev/null @@ -1,5 +0,0 @@ - -class Foo { -public: - int type(); -}; diff --git a/libbindgen/tests/headers/module-whitelisted.hpp b/libbindgen/tests/headers/module-whitelisted.hpp deleted file mode 100644 index f41e874e..00000000 --- a/libbindgen/tests/headers/module-whitelisted.hpp +++ /dev/null @@ -1,2 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces -struct Test {}; diff --git a/libbindgen/tests/headers/msvc-no-usr.hpp b/libbindgen/tests/headers/msvc-no-usr.hpp deleted file mode 100644 index b15e49f5..00000000 --- a/libbindgen/tests/headers/msvc-no-usr.hpp +++ /dev/null @@ -1,8 +0,0 @@ - -typedef unsigned long long size_t; - -class A { - const size_t foo; - - A() : foo(5) {} -}; diff --git a/libbindgen/tests/headers/multiple-inherit-empty-correct-layout.hpp b/libbindgen/tests/headers/multiple-inherit-empty-correct-layout.hpp deleted file mode 100644 index 1e2b133a..00000000 --- a/libbindgen/tests/headers/multiple-inherit-empty-correct-layout.hpp +++ /dev/null @@ -1,3 +0,0 @@ -struct Foo {}; -struct Bar {}; -struct Baz : public Foo, public Bar {}; diff --git a/libbindgen/tests/headers/mutable.hpp b/libbindgen/tests/headers/mutable.hpp deleted file mode 100644 index b61a1031..00000000 --- a/libbindgen/tests/headers/mutable.hpp +++ /dev/null @@ -1,14 +0,0 @@ -class C { - mutable int m_member; - int m_other; -}; - -class NonCopiable { - mutable int m_member; - - ~NonCopiable() {}; -}; - -class NonCopiableWithNonCopiableMutableMember { - mutable NonCopiable m_member; -}; diff --git a/libbindgen/tests/headers/namespace.hpp b/libbindgen/tests/headers/namespace.hpp deleted file mode 100644 index 65788539..00000000 --- a/libbindgen/tests/headers/namespace.hpp +++ /dev/null @@ -1,47 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces - -void top_level(); - -namespace whatever { - typedef int whatever_int_t; - - void in_whatever(); -} - -namespace { - namespace empty {} - - void foo(); - struct A { - whatever::whatever_int_t b; - public: - int lets_hope_this_works(); - }; -} - -template<typename T> -class C: public A { - T m_c; - T* m_c_ptr; - T m_c_arr[10]; -}; - - -template<> -class C<int>; - - -namespace w { - typedef unsigned int whatever_int_t; - - template<typename T> - class D { - C<T> m_c; - }; - - whatever_int_t heh(); // this should return w::whatever_int_t, and not whatever::whatever_int_t - - C<int> foo(); - - C<float> barr(); // <- This is the problematic one -} diff --git a/libbindgen/tests/headers/nested.hpp b/libbindgen/tests/headers/nested.hpp deleted file mode 100644 index 299e1768..00000000 --- a/libbindgen/tests/headers/nested.hpp +++ /dev/null @@ -1,15 +0,0 @@ - -class Calc { - int w; -}; - -class Test { -public: - struct Size; - friend struct Size; - struct Size { - struct Dimension : public Calc { - }; - Dimension mWidth, mHeight; - }; -}; diff --git a/libbindgen/tests/headers/nested_vtable.hpp b/libbindgen/tests/headers/nested_vtable.hpp deleted file mode 100644 index 87d6ce1f..00000000 --- a/libbindgen/tests/headers/nested_vtable.hpp +++ /dev/null @@ -1,8 +0,0 @@ -class nsISupports { -public: - virtual nsISupports* QueryInterface(); -}; - -class nsIRunnable : public nsISupports {}; - -class Runnable : public nsIRunnable {}; diff --git a/libbindgen/tests/headers/nested_within_namespace.hpp b/libbindgen/tests/headers/nested_within_namespace.hpp deleted file mode 100644 index a9b7c1ec..00000000 --- a/libbindgen/tests/headers/nested_within_namespace.hpp +++ /dev/null @@ -1,15 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces - -namespace foo { - class Bar { - int foo; - - class Baz { - int foo; - }; - }; - - class Baz { - int baz; - }; -} diff --git a/libbindgen/tests/headers/no-std.h b/libbindgen/tests/headers/no-std.h deleted file mode 100644 index 7bee9657..00000000 --- a/libbindgen/tests/headers/no-std.h +++ /dev/null @@ -1,5 +0,0 @@ -// bindgen-flags: --ctypes-prefix "libc" --use-core --raw-line "#![no_std]" --raw-line "mod libc { pub type c_int = i32; pub enum c_void {} }" -struct foo { - int a, b; - void* bar; -}; diff --git a/libbindgen/tests/headers/no_copy.hpp b/libbindgen/tests/headers/no_copy.hpp deleted file mode 100644 index 349e428e..00000000 --- a/libbindgen/tests/headers/no_copy.hpp +++ /dev/null @@ -1,6 +0,0 @@ - -/** <div rustbindgen nocopy></div> */ -template<typename T> -class CopiableButWait { - int whatever; -}; diff --git a/libbindgen/tests/headers/nsStyleAutoArray.hpp b/libbindgen/tests/headers/nsStyleAutoArray.hpp deleted file mode 100644 index 950152c0..00000000 --- a/libbindgen/tests/headers/nsStyleAutoArray.hpp +++ /dev/null @@ -1,57 +0,0 @@ - -template<typename T> -class nsTArray { - T* mBuff; -}; - -template<typename T> -class nsStyleAutoArray -{ -public: - // This constructor places a single element in mFirstElement. - enum WithSingleInitialElement { WITH_SINGLE_INITIAL_ELEMENT }; - explicit nsStyleAutoArray(WithSingleInitialElement) {} - nsStyleAutoArray(const nsStyleAutoArray& aOther) { *this = aOther; } - nsStyleAutoArray& operator=(const nsStyleAutoArray& aOther) { - mFirstElement = aOther.mFirstElement; - mOtherElements = aOther.mOtherElements; - return *this; - } - - bool operator==(const nsStyleAutoArray& aOther) const { - return Length() == aOther.Length() && - mFirstElement == aOther.mFirstElement && - mOtherElements == aOther.mOtherElements; - } - bool operator!=(const nsStyleAutoArray& aOther) const { - return !(*this == aOther); - } - - unsigned long Length() const { - return mOtherElements.Length() + 1; - } - const T& operator[](unsigned long aIndex) const { - return aIndex == 0 ? mFirstElement : mOtherElements[aIndex - 1]; - } - T& operator[](unsigned long aIndex) { - return aIndex == 0 ? mFirstElement : mOtherElements[aIndex - 1]; - } - - void EnsureLengthAtLeast(unsigned long aMinLen) { - if (aMinLen > 0) { - mOtherElements.EnsureLengthAtLeast(aMinLen - 1); - } - } - - void SetLengthNonZero(unsigned long aNewLen) { - mOtherElements.SetLength(aNewLen - 1); - } - - void TruncateLengthNonZero(unsigned long aNewLen) { - mOtherElements.TruncateLength(aNewLen - 1); - } - -private: - T mFirstElement; - nsTArray<T> mOtherElements; -}; diff --git a/libbindgen/tests/headers/only_bitfields.hpp b/libbindgen/tests/headers/only_bitfields.hpp deleted file mode 100644 index 84db0586..00000000 --- a/libbindgen/tests/headers/only_bitfields.hpp +++ /dev/null @@ -1,5 +0,0 @@ -// bindgen-flags: --no-unstable-rust -class C { - bool a: 1; - bool b: 7; -}; diff --git a/libbindgen/tests/headers/opaque-tracing.hpp b/libbindgen/tests/headers/opaque-tracing.hpp deleted file mode 100644 index 7356245e..00000000 --- a/libbindgen/tests/headers/opaque-tracing.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// bindgen-flags: --opaque-type=.* --whitelist-function=foo - -class Container; - -// The whitelist tracing should reach the Container type, even though it's -// marked as opaque. -void foo(Container* c); - -template<typename T> -class Wat { - T foo; -}; - -class OtherOpaque { - int bar; -}; - -class Container { - Wat<int> bar; - OtherOpaque baz; -}; diff --git a/libbindgen/tests/headers/opaque_in_struct.hpp b/libbindgen/tests/headers/opaque_in_struct.hpp deleted file mode 100644 index 3cffeb20..00000000 --- a/libbindgen/tests/headers/opaque_in_struct.hpp +++ /dev/null @@ -1,10 +0,0 @@ - - -/** <div rustbindgen opaque> */ -typedef struct opaque { - int waht; -} opaque; - -struct container { - opaque contained; -}; diff --git a/libbindgen/tests/headers/opaque_pointer.hpp b/libbindgen/tests/headers/opaque_pointer.hpp deleted file mode 100644 index 53f8ce1f..00000000 --- a/libbindgen/tests/headers/opaque_pointer.hpp +++ /dev/null @@ -1,22 +0,0 @@ - -/** - * <div rustbindgen opaque></div> - */ -struct OtherOpaque { - int c; -}; - -/** - * <div rustbindgen opaque></div> - */ -template <typename T> -struct Opaque { - T whatever; -}; - -struct WithOpaquePtr { - Opaque<int>* whatever; - Opaque<float> other; - OtherOpaque t; -}; - diff --git a/libbindgen/tests/headers/opaque_typedef.hpp b/libbindgen/tests/headers/opaque_typedef.hpp deleted file mode 100644 index 25640738..00000000 --- a/libbindgen/tests/headers/opaque_typedef.hpp +++ /dev/null @@ -1,17 +0,0 @@ -// bindgen-flags: -- -std=c++11 -template<typename T> -class RandomTemplate; - -template<int i> -class Wat; - -template<int i> -class Wat3; - -template<> -class Wat3<3>; - -/** <div rustbindgen opaque></div> */ -typedef RandomTemplate<int> ShouldBeOpaque; - -typedef RandomTemplate<float> ShouldNotBeOpaque; diff --git a/libbindgen/tests/headers/overflowed_enum.hpp b/libbindgen/tests/headers/overflowed_enum.hpp deleted file mode 100644 index 1f2075a5..00000000 --- a/libbindgen/tests/headers/overflowed_enum.hpp +++ /dev/null @@ -1,12 +0,0 @@ -// bindgen-flags: -- -std=c++11 -Wno-narrowing - -enum Foo { - BAP_ARM = 0x93fcb9, - BAP_X86 = 0xb67eed, - BAP_X86_64 = 0xba7b274f, -}; - -enum Bar: unsigned short { - One = 1, - Big = 65538, -}; diff --git a/libbindgen/tests/headers/overloading.hpp b/libbindgen/tests/headers/overloading.hpp deleted file mode 100644 index 3c2b0487..00000000 --- a/libbindgen/tests/headers/overloading.hpp +++ /dev/null @@ -1,9 +0,0 @@ -extern bool Evaluate(char r); -extern bool Evaluate(int x, int y); - -namespace foo { - extern void MyFunction(); -} -namespace bar { - extern void MyFunction(); -} diff --git a/libbindgen/tests/headers/private.hpp b/libbindgen/tests/headers/private.hpp deleted file mode 100644 index c0f3ce7f..00000000 --- a/libbindgen/tests/headers/private.hpp +++ /dev/null @@ -1,21 +0,0 @@ - -struct HasPrivate { - int mNotPrivate; - /** <div rustbindgen private></div> */ - int mIsPrivate; -}; - - -/** <div rustbindgen private></div> */ -struct VeryPrivate { - int mIsPrivate; - int mIsAlsoPrivate; -}; - - -/** <div rustbindgen private></div> */ -struct ContradictPrivate { - /** <div rustbindgen private="false"></div> */ - int mNotPrivate; - int mIsPrivate; -}; diff --git a/libbindgen/tests/headers/public-dtor.hpp b/libbindgen/tests/headers/public-dtor.hpp deleted file mode 100644 index 5d4fb592..00000000 --- a/libbindgen/tests/headers/public-dtor.hpp +++ /dev/null @@ -1,15 +0,0 @@ - - -namespace cv { -class String { -public: - ~String(); -}; - - -inline -String::~String() -{ -} - -} diff --git a/libbindgen/tests/headers/redeclaration.hpp b/libbindgen/tests/headers/redeclaration.hpp deleted file mode 100644 index d536b158..00000000 --- a/libbindgen/tests/headers/redeclaration.hpp +++ /dev/null @@ -1,7 +0,0 @@ -extern "C" { - void foo(); -} - -extern "C" { - void foo(); -} diff --git a/libbindgen/tests/headers/ref_argument_array.hpp b/libbindgen/tests/headers/ref_argument_array.hpp deleted file mode 100644 index dc73fd62..00000000 --- a/libbindgen/tests/headers/ref_argument_array.hpp +++ /dev/null @@ -1,6 +0,0 @@ - -#define NSID_LENGTH 10 -class nsID { -public: - virtual void ToProvidedString(char (&aDest)[NSID_LENGTH]) = 0; -}; diff --git a/libbindgen/tests/headers/reparented_replacement.hpp b/libbindgen/tests/headers/reparented_replacement.hpp deleted file mode 100644 index 4ac2bf03..00000000 --- a/libbindgen/tests/headers/reparented_replacement.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces - -namespace foo { - struct Bar { - int baz; - }; -} - -namespace bar { - /// <div rustbindgen replaces="foo::Bar"></div> - struct Bar_Replacement { - int bazz; - }; -}; - -typedef foo::Bar ReferencesBar; diff --git a/libbindgen/tests/headers/replace_template_alias.hpp b/libbindgen/tests/headers/replace_template_alias.hpp deleted file mode 100644 index c325b5a3..00000000 --- a/libbindgen/tests/headers/replace_template_alias.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// bindgen-flags: -- --std=c++14 - -namespace JS { -namespace detail { - -/// Notice how this doesn't use T. -template <typename T> -using MaybeWrapped = int; - -} - -template <typename T> -class Rooted { - detail::MaybeWrapped<T> ptr; -}; - -} - -/// But the replacement type does use T! -/// -/// <div rustbindgen replaces="JS::detail::MaybeWrapped" /> -template <typename T> -using replaces_MaybeWrapped = T; diff --git a/libbindgen/tests/headers/replace_use.hpp b/libbindgen/tests/headers/replace_use.hpp deleted file mode 100644 index de44eb19..00000000 --- a/libbindgen/tests/headers/replace_use.hpp +++ /dev/null @@ -1,15 +0,0 @@ -template<typename T> -struct nsTArray { - int x; -}; -/** - * <div rustbindgen replaces="nsTArray"></div> - */ -template<typename T> -struct nsTArray_Simple { - unsigned int y; -}; - -struct Test { - nsTArray<long> a; -}; diff --git a/libbindgen/tests/headers/replaces_double.hpp b/libbindgen/tests/headers/replaces_double.hpp deleted file mode 100644 index 1a78b0d9..00000000 --- a/libbindgen/tests/headers/replaces_double.hpp +++ /dev/null @@ -1,20 +0,0 @@ -// bindgen-flags: --blacklist-type Wrapper -- --std=c++11 - -template<typename T> -struct Wrapper { - struct Wrapped { - T t; - }; - using Type = Wrapped; -}; - -template<typename T> -class Rooted { - using MaybeWrapped = typename Wrapper<T>::Type; - MaybeWrapped ptr; - - /** - * <div rustbindgen replaces="Rooted_MaybeWrapped"></div> - */ - using MaybeWrapped_simple = T; -}; diff --git a/libbindgen/tests/headers/resolved_type_def_function.h b/libbindgen/tests/headers/resolved_type_def_function.h deleted file mode 100644 index 139b8c3e..00000000 --- a/libbindgen/tests/headers/resolved_type_def_function.h +++ /dev/null @@ -1,2 +0,0 @@ -typedef void (FuncType) (); -extern FuncType Func;
\ No newline at end of file diff --git a/libbindgen/tests/headers/same_struct_name_in_different_namespaces.hpp b/libbindgen/tests/headers/same_struct_name_in_different_namespaces.hpp deleted file mode 100644 index fe685845..00000000 --- a/libbindgen/tests/headers/same_struct_name_in_different_namespaces.hpp +++ /dev/null @@ -1,12 +0,0 @@ -namespace JS { - - struct Zone; - - namespace shadow { - - struct Zone { - int x; - int y; - }; - } -} diff --git a/libbindgen/tests/headers/size_t_template.hpp b/libbindgen/tests/headers/size_t_template.hpp deleted file mode 100644 index 6045c698..00000000 --- a/libbindgen/tests/headers/size_t_template.hpp +++ /dev/null @@ -1,8 +0,0 @@ -template<typename T, unsigned long N> -class Array { - T inner[N]; -}; - -class C { - Array<int, 3> arr; -}; diff --git a/libbindgen/tests/headers/struct_containing_forward_declared_struct.h b/libbindgen/tests/headers/struct_containing_forward_declared_struct.h deleted file mode 100644 index d38aca2f..00000000 --- a/libbindgen/tests/headers/struct_containing_forward_declared_struct.h +++ /dev/null @@ -1,7 +0,0 @@ -struct a { - struct b* val_a; -}; - -struct b { - int val_b; -}; diff --git a/libbindgen/tests/headers/struct_with_anon_struct.h b/libbindgen/tests/headers/struct_with_anon_struct.h deleted file mode 100644 index 1617d7a8..00000000 --- a/libbindgen/tests/headers/struct_with_anon_struct.h +++ /dev/null @@ -1,6 +0,0 @@ -struct foo { - struct { - int a; - int b; - } bar; -}; diff --git a/libbindgen/tests/headers/struct_with_anon_struct_array.h b/libbindgen/tests/headers/struct_with_anon_struct_array.h deleted file mode 100644 index 9ea977e8..00000000 --- a/libbindgen/tests/headers/struct_with_anon_struct_array.h +++ /dev/null @@ -1,10 +0,0 @@ -struct foo { - struct { - int a; - int b; - } bar[2]; - struct { - int a; - int b; - } baz[2][3][4]; -}; diff --git a/libbindgen/tests/headers/struct_with_anon_struct_pointer.h b/libbindgen/tests/headers/struct_with_anon_struct_pointer.h deleted file mode 100644 index 0c486d84..00000000 --- a/libbindgen/tests/headers/struct_with_anon_struct_pointer.h +++ /dev/null @@ -1,6 +0,0 @@ -struct foo { - struct { - int a; - int b; - } *bar; -}; diff --git a/libbindgen/tests/headers/struct_with_anon_union.h b/libbindgen/tests/headers/struct_with_anon_union.h deleted file mode 100644 index 3a92b940..00000000 --- a/libbindgen/tests/headers/struct_with_anon_union.h +++ /dev/null @@ -1,6 +0,0 @@ -struct foo { - union { - unsigned int a; - unsigned short b; - } bar; -}; diff --git a/libbindgen/tests/headers/struct_with_anon_unnamed_struct.h b/libbindgen/tests/headers/struct_with_anon_unnamed_struct.h deleted file mode 100644 index f8ac4225..00000000 --- a/libbindgen/tests/headers/struct_with_anon_unnamed_struct.h +++ /dev/null @@ -1,6 +0,0 @@ -struct foo { - struct { - unsigned int a; - unsigned int b; - }; -}; diff --git a/libbindgen/tests/headers/struct_with_anon_unnamed_union.h b/libbindgen/tests/headers/struct_with_anon_unnamed_union.h deleted file mode 100644 index 7158e727..00000000 --- a/libbindgen/tests/headers/struct_with_anon_unnamed_union.h +++ /dev/null @@ -1,6 +0,0 @@ -struct foo { - union { - unsigned int a; - unsigned short b; - }; -}; diff --git a/libbindgen/tests/headers/struct_with_bitfields.h b/libbindgen/tests/headers/struct_with_bitfields.h deleted file mode 100644 index 107fb136..00000000 --- a/libbindgen/tests/headers/struct_with_bitfields.h +++ /dev/null @@ -1,13 +0,0 @@ -// bindgen-flags: --no-unstable-rust -struct bitfield { - unsigned short - a :1, - b :1, - c :1, - :1, - :2, - d :2; - int e; - unsigned int f : 2; - unsigned int g : 32; -}; diff --git a/libbindgen/tests/headers/struct_with_derive_debug.h b/libbindgen/tests/headers/struct_with_derive_debug.h deleted file mode 100644 index 98ba1b3d..00000000 --- a/libbindgen/tests/headers/struct_with_derive_debug.h +++ /dev/null @@ -1,15 +0,0 @@ -struct LittleArray { - int a[32]; -}; - -struct BigArray{ - int a[33]; -}; - -struct WithLittleArray { - struct LittleArray a; -}; - -struct WithBigArray { - struct BigArray a; -}; diff --git a/libbindgen/tests/headers/struct_with_nesting.h b/libbindgen/tests/headers/struct_with_nesting.h deleted file mode 100644 index 9d7fa176..00000000 --- a/libbindgen/tests/headers/struct_with_nesting.h +++ /dev/null @@ -1,17 +0,0 @@ -struct foo { - unsigned int a; - union { - unsigned int b; - struct { - unsigned short c1; - unsigned short c2; - }; - - struct { - unsigned char d1; - unsigned char d2; - unsigned char d3; - unsigned char d4; - }; - }; -}; diff --git a/libbindgen/tests/headers/struct_with_packing.h b/libbindgen/tests/headers/struct_with_packing.h deleted file mode 100644 index 1b9fe131..00000000 --- a/libbindgen/tests/headers/struct_with_packing.h +++ /dev/null @@ -1,4 +0,0 @@ -struct a { - char b; - short c; -} __attribute__((packed)); diff --git a/libbindgen/tests/headers/struct_with_struct.h b/libbindgen/tests/headers/struct_with_struct.h deleted file mode 100644 index 78b1cc81..00000000 --- a/libbindgen/tests/headers/struct_with_struct.h +++ /dev/null @@ -1,6 +0,0 @@ -struct foo { - struct { - unsigned int x; - unsigned int y; - } bar; -}; diff --git a/libbindgen/tests/headers/struct_with_typedef_template_arg.hpp b/libbindgen/tests/headers/struct_with_typedef_template_arg.hpp deleted file mode 100644 index 7fed21ab..00000000 --- a/libbindgen/tests/headers/struct_with_typedef_template_arg.hpp +++ /dev/null @@ -1,4 +0,0 @@ -template<typename T, typename ...Args> -struct Proxy { - typedef void (*foo)(T* bar); -}; diff --git a/libbindgen/tests/headers/template.hpp b/libbindgen/tests/headers/template.hpp deleted file mode 100644 index c13643c3..00000000 --- a/libbindgen/tests/headers/template.hpp +++ /dev/null @@ -1,144 +0,0 @@ -template<typename T, typename U> class Foo { - T m_member; - T* m_member_ptr; - T m_member_arr[1]; -}; - -void bar(Foo<int, int> foo); - -template<typename T> -class D { - typedef Foo<int, int> MyFoo; - - MyFoo m_foo; - - template<typename Z> - class U { - MyFoo m_nested_foo; - Z m_baz; - }; -}; - -template<typename T> -class Rooted { - T* prev; - Rooted<void*>* next; - T ptr; -}; - -class RootedContainer { - Rooted<void*> root; -}; - -template<typename T> -class WithDtor; - -typedef WithDtor<int> WithDtorIntFwd; - -template<typename T> -class WithDtor { - T member; - ~WithDtor() {} -}; - -class PODButContainsDtor { - WithDtorIntFwd member; -}; - - -/** <div rustbindgen opaque> */ -template<typename T> -class Opaque { - T member; -}; - -class POD { - Opaque<int> opaque_member; -}; - -/** - * <div rustbindgen replaces="NestedReplaced"></div> - */ -template<typename T> -class Nested { - T* buff; -}; - -template<typename T, typename U> -class NestedBase { - T* buff; -}; - -template<typename T> -class NestedReplaced: public NestedBase<T, int> { -}; - -template<typename T> -class Incomplete; - -template<typename T> -class NestedContainer { - T c; -private: - NestedReplaced<T> nested; - Incomplete<T> inc; -}; - -template<typename T> -class Incomplete { - T d; -}; - -class Untemplated {}; - -template<typename T> -class Templated { - Untemplated m_untemplated; -}; - -/** - * If the replacement doesn't happen at the parse level the container would be - * copy and the replacement wouldn't, so this wouldn't compile. - * - * <div rustbindgen replaces="ReplacedWithoutDestructor"></div> - */ -template<typename T> -class ReplacedWithDestructor { - T* buff; - ~ReplacedWithDestructor() {}; -}; - -template<typename T> -class ReplacedWithoutDestructor { - T* buff; -}; - -template<typename T> -class ReplacedWithoutDestructorFwd; - -template<typename T> -class ShouldNotBeCopiable { - ReplacedWithoutDestructor<T> m_member; -}; - -template<typename U> -class ShouldNotBeCopiableAsWell { - ReplacedWithoutDestructorFwd<U> m_member; -}; - -/** - * If the replacement doesn't happen at the parse level the container would be - * copy and the replacement wouldn't, so this wouldn't compile. - * - * <div rustbindgen replaces="ReplacedWithoutDestructorFwd"></div> - */ -template<typename T> -class ReplacedWithDestructorDeclaredAfter { - T* buff; - ~ReplacedWithDestructorDeclaredAfter() {}; -}; - -template<typename T> -class TemplateWithVar { - static T var = 0; -}; diff --git a/libbindgen/tests/headers/template_alias.hpp b/libbindgen/tests/headers/template_alias.hpp deleted file mode 100644 index 646d9f40..00000000 --- a/libbindgen/tests/headers/template_alias.hpp +++ /dev/null @@ -1,13 +0,0 @@ -// bindgen-flags: -- -std=c++14 - -namespace JS { -namespace detail { - template <typename T> - using Wrapped = T; -} - -template <typename T> -struct Rooted { - detail::Wrapped<T> ptr; -}; -} diff --git a/libbindgen/tests/headers/template_alias_basic.hpp b/libbindgen/tests/headers/template_alias_basic.hpp deleted file mode 100644 index 964f6e27..00000000 --- a/libbindgen/tests/headers/template_alias_basic.hpp +++ /dev/null @@ -1,4 +0,0 @@ -// bindgen-flags: -- -std=c++11 - -template<typename T> -using Wrapped = T; diff --git a/libbindgen/tests/headers/template_alias_namespace.hpp b/libbindgen/tests/headers/template_alias_namespace.hpp deleted file mode 100644 index bd637166..00000000 --- a/libbindgen/tests/headers/template_alias_namespace.hpp +++ /dev/null @@ -1,13 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces -- -std=c++14 - -namespace JS { -namespace detail { - template <typename T> - using Wrapped = T; -} - -template <typename T> -struct Rooted { - detail::Wrapped<T> ptr; -}; -} diff --git a/libbindgen/tests/headers/template_typedef_transitive_param.hpp b/libbindgen/tests/headers/template_typedef_transitive_param.hpp deleted file mode 100644 index 2269ac36..00000000 --- a/libbindgen/tests/headers/template_typedef_transitive_param.hpp +++ /dev/null @@ -1,7 +0,0 @@ -template<typename T> -struct Wrapper { - struct Wrapped { - T t; - }; - using Type = Wrapped; -}; diff --git a/libbindgen/tests/headers/template_typedefs.hpp b/libbindgen/tests/headers/template_typedefs.hpp deleted file mode 100644 index 5e13dcd8..00000000 --- a/libbindgen/tests/headers/template_typedefs.hpp +++ /dev/null @@ -1,8 +0,0 @@ -typedef void (*foo)(int); - -template<typename T, typename U> -class Foo { - typedef T Char; - typedef Char* FooPtrTypedef; - typedef bool (*nsCOMArrayEnumFunc)(T* aElement, void* aData); -}; diff --git a/libbindgen/tests/headers/templateref_opaque.hpp b/libbindgen/tests/headers/templateref_opaque.hpp deleted file mode 100644 index ca154c34..00000000 --- a/libbindgen/tests/headers/templateref_opaque.hpp +++ /dev/null @@ -1,11 +0,0 @@ - -namespace detail { -template<typename T> -struct PointerType { - typedef T* Type; -}; -} -template<typename T> -class UniquePtr { - typedef typename detail::PointerType<T> Pointer; -}; diff --git a/libbindgen/tests/headers/type-referenced-by-whitelisted-function.h b/libbindgen/tests/headers/type-referenced-by-whitelisted-function.h deleted file mode 100644 index 86b00303..00000000 --- a/libbindgen/tests/headers/type-referenced-by-whitelisted-function.h +++ /dev/null @@ -1,7 +0,0 @@ -// bindgen-flags: --whitelist-function dl_iterate_phdr - -struct dl_phdr_info { - int x; -}; - -int dl_iterate_phdr(struct dl_phdr_info *); diff --git a/libbindgen/tests/headers/type_alias_empty.hpp b/libbindgen/tests/headers/type_alias_empty.hpp deleted file mode 100644 index f0760c8f..00000000 --- a/libbindgen/tests/headers/type_alias_empty.hpp +++ /dev/null @@ -1,10 +0,0 @@ -// bindgen-flags: --whitelist-type bool_constant -- -std=c++11 - -// NB: The --whitelist-type is done to trigger the traversal of the types on -// codegen in order to trigger #67. - -template<typename T, T Val> -struct integral_constant {}; - -template<bool B> -using bool_constant = integral_constant<bool, B>; diff --git a/libbindgen/tests/headers/type_alias_partial_template_especialization.hpp b/libbindgen/tests/headers/type_alias_partial_template_especialization.hpp deleted file mode 100644 index dfc36786..00000000 --- a/libbindgen/tests/headers/type_alias_partial_template_especialization.hpp +++ /dev/null @@ -1,7 +0,0 @@ -// bindgen-flags: -- -std=c++14 -template <typename A> using MaybeWrapped = A; - -template<class T> -class Rooted { - MaybeWrapped<T> ptr; -}; diff --git a/libbindgen/tests/headers/type_alias_template_specialized.hpp b/libbindgen/tests/headers/type_alias_template_specialized.hpp deleted file mode 100644 index a2d32b56..00000000 --- a/libbindgen/tests/headers/type_alias_template_specialized.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// bindgen-flags: --whitelist-type Rooted -- -std=c++14 - -template <typename a> using MaybeWrapped = a; -class Rooted { - MaybeWrapped<int> ptr; -}; - -/// <div rustbindgen replaces="MaybeWrapped"></div> -template <typename a> using replaces_MaybeWrapped = a; diff --git a/libbindgen/tests/headers/typedefd-array-as-function-arg.h b/libbindgen/tests/headers/typedefd-array-as-function-arg.h deleted file mode 100644 index 93790591..00000000 --- a/libbindgen/tests/headers/typedefd-array-as-function-arg.h +++ /dev/null @@ -1,3 +0,0 @@ -// foo.h -typedef float myVector3[3]; -void modifyVectorFunc(myVector3 v); diff --git a/libbindgen/tests/headers/typeref.hpp b/libbindgen/tests/headers/typeref.hpp deleted file mode 100644 index b94c98ef..00000000 --- a/libbindgen/tests/headers/typeref.hpp +++ /dev/null @@ -1,28 +0,0 @@ -struct nsFoo; - -namespace mozilla { - -struct FragmentOrURL { bool mIsLocalRef; }; -struct Position { }; - -} // namespace mozilla - -class Bar { - nsFoo* mFoo; -}; - -namespace mozilla { - -template<typename ReferenceBox> -struct StyleShapeSource { - union { - Position* mPosition; - FragmentOrURL* mFragmentOrURL; - }; -}; - -} // namespace mozilla - -struct nsFoo { - mozilla::StyleShapeSource<int> mBar; -}; diff --git a/libbindgen/tests/headers/union-in-ns.hpp b/libbindgen/tests/headers/union-in-ns.hpp deleted file mode 100644 index 68b8f72d..00000000 --- a/libbindgen/tests/headers/union-in-ns.hpp +++ /dev/null @@ -1,5 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces - -union bar { - int baz; -}; diff --git a/libbindgen/tests/headers/union_dtor.hpp b/libbindgen/tests/headers/union_dtor.hpp deleted file mode 100644 index 399dc89d..00000000 --- a/libbindgen/tests/headers/union_dtor.hpp +++ /dev/null @@ -1,5 +0,0 @@ -union UnionWithDtor { - ~UnionWithDtor(); - int mFoo; - void* mBar; -}; diff --git a/libbindgen/tests/headers/union_fields.hpp b/libbindgen/tests/headers/union_fields.hpp deleted file mode 100644 index aec3a7fd..00000000 --- a/libbindgen/tests/headers/union_fields.hpp +++ /dev/null @@ -1,5 +0,0 @@ -typedef union { - int mInt; - float mFloat; - void* mPointer; -} nsStyleUnion; diff --git a/libbindgen/tests/headers/union_template.hpp b/libbindgen/tests/headers/union_template.hpp deleted file mode 100644 index 0d0a9bb3..00000000 --- a/libbindgen/tests/headers/union_template.hpp +++ /dev/null @@ -1,19 +0,0 @@ -template<typename T> -struct NastyStruct { - bool mIsSome; - union { - void* mFoo; - unsigned long mDummy; - } mStorage; - - union { - short wat; - int* wut; - }; -}; - -template<typename T> -union Whatever { - void* mTPtr; - int mInt; -}; diff --git a/libbindgen/tests/headers/union_with_anon_struct.h b/libbindgen/tests/headers/union_with_anon_struct.h deleted file mode 100644 index 7f8dec95..00000000 --- a/libbindgen/tests/headers/union_with_anon_struct.h +++ /dev/null @@ -1,6 +0,0 @@ -union foo { - struct { - unsigned int a; - unsigned int b; - } bar; -}; diff --git a/libbindgen/tests/headers/union_with_anon_struct_bitfield.h b/libbindgen/tests/headers/union_with_anon_struct_bitfield.h deleted file mode 100644 index 24c7dce8..00000000 --- a/libbindgen/tests/headers/union_with_anon_struct_bitfield.h +++ /dev/null @@ -1,8 +0,0 @@ -// bindgen-flags: --no-unstable-rust -union foo { - int a; - struct { - int b : 7; - int c : 25; - }; -}; diff --git a/libbindgen/tests/headers/union_with_anon_union.h b/libbindgen/tests/headers/union_with_anon_union.h deleted file mode 100644 index 212431b8..00000000 --- a/libbindgen/tests/headers/union_with_anon_union.h +++ /dev/null @@ -1,6 +0,0 @@ -union foo { - union { - unsigned int a; - unsigned short b; - } bar; -}; diff --git a/libbindgen/tests/headers/union_with_anon_unnamed_struct.h b/libbindgen/tests/headers/union_with_anon_unnamed_struct.h deleted file mode 100644 index 79558049..00000000 --- a/libbindgen/tests/headers/union_with_anon_unnamed_struct.h +++ /dev/null @@ -1,9 +0,0 @@ -union pixel { - unsigned int rgba; - struct { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; - }; -}; diff --git a/libbindgen/tests/headers/union_with_anon_unnamed_union.h b/libbindgen/tests/headers/union_with_anon_unnamed_union.h deleted file mode 100644 index 7580771a..00000000 --- a/libbindgen/tests/headers/union_with_anon_unnamed_union.h +++ /dev/null @@ -1,7 +0,0 @@ -union foo { - unsigned int a; - union { - unsigned short b; - unsigned char c; - }; -}; diff --git a/libbindgen/tests/headers/union_with_big_member.h b/libbindgen/tests/headers/union_with_big_member.h deleted file mode 100644 index 6347d6ca..00000000 --- a/libbindgen/tests/headers/union_with_big_member.h +++ /dev/null @@ -1,14 +0,0 @@ -union WithBigArray { - int a; - int b[33]; -}; - -union WithBigArray2 { - int a; - char b[33]; -}; - -union WithBigMember { - int a; - union WithBigArray b; -}; diff --git a/libbindgen/tests/headers/union_with_nesting.h b/libbindgen/tests/headers/union_with_nesting.h deleted file mode 100644 index cd907d57..00000000 --- a/libbindgen/tests/headers/union_with_nesting.h +++ /dev/null @@ -1,14 +0,0 @@ -union foo { - unsigned int a; - struct { - union { - unsigned short b1; - unsigned short b2; - }; - - union { - unsigned short c1; - unsigned short c2; - }; - }; -}; diff --git a/libbindgen/tests/headers/unknown_attr.h b/libbindgen/tests/headers/unknown_attr.h deleted file mode 100644 index f87e9f0b..00000000 --- a/libbindgen/tests/headers/unknown_attr.h +++ /dev/null @@ -1,6 +0,0 @@ -typedef struct { - long long __clang_max_align_nonce1 - __attribute__((__aligned__(__alignof__(long long)))); - long double __clang_max_align_nonce2 - __attribute__((__aligned__(__alignof__(long double)))); -} max_align_t; diff --git a/libbindgen/tests/headers/use-core.h b/libbindgen/tests/headers/use-core.h deleted file mode 100644 index 42bb10d9..00000000 --- a/libbindgen/tests/headers/use-core.h +++ /dev/null @@ -1,8 +0,0 @@ -// bindgen-flags: --use-core --raw-line "extern crate core;" - -struct foo { - int a, b; - void* bar; -}; - -typedef void (*fooFunction)(int bar); diff --git a/libbindgen/tests/headers/using.hpp b/libbindgen/tests/headers/using.hpp deleted file mode 100644 index ba07b9c8..00000000 --- a/libbindgen/tests/headers/using.hpp +++ /dev/null @@ -1,11 +0,0 @@ -// bindgen-flags: -- -std=c++11 - -template<typename T> -class Point { - T x; - T y; -}; - -typedef Point<int> IntPoint2D; - -using IntVec2D = Point<int>; diff --git a/libbindgen/tests/headers/var-tracing.hpp b/libbindgen/tests/headers/var-tracing.hpp deleted file mode 100644 index 0d0b0cca..00000000 --- a/libbindgen/tests/headers/var-tracing.hpp +++ /dev/null @@ -1,10 +0,0 @@ -// bindgen-flags: --whitelist-type Baz - -struct Bar { - const int m_baz; - Bar(int baz); -}; - -class Baz { - static const Bar FOO[]; -}; diff --git a/libbindgen/tests/headers/variadic-method.hpp b/libbindgen/tests/headers/variadic-method.hpp deleted file mode 100644 index 78a8eb45..00000000 --- a/libbindgen/tests/headers/variadic-method.hpp +++ /dev/null @@ -1,6 +0,0 @@ - -void foo(const char* fmt, ...); - -struct Bar { - void foo(const char* fmt, ...); -}; diff --git a/libbindgen/tests/headers/variadic_template_function.hpp b/libbindgen/tests/headers/variadic_template_function.hpp deleted file mode 100644 index 4942d8f0..00000000 --- a/libbindgen/tests/headers/variadic_template_function.hpp +++ /dev/null @@ -1,6 +0,0 @@ - -template <typename T> -class VariadicFunctionObject { -public: - int add_em_up(T count,...); -}; diff --git a/libbindgen/tests/headers/vector.hpp b/libbindgen/tests/headers/vector.hpp deleted file mode 100644 index 4707f77f..00000000 --- a/libbindgen/tests/headers/vector.hpp +++ /dev/null @@ -1,3 +0,0 @@ -struct foo { - __attribute__((__vector_size__(1 * sizeof(long long)))) long long mMember; -}; diff --git a/libbindgen/tests/headers/virtual_dtor.hpp b/libbindgen/tests/headers/virtual_dtor.hpp deleted file mode 100644 index c35dcab1..00000000 --- a/libbindgen/tests/headers/virtual_dtor.hpp +++ /dev/null @@ -1,3 +0,0 @@ -struct nsSlots { - virtual ~nsSlots(); -}; diff --git a/libbindgen/tests/headers/virtual_inheritance.hpp b/libbindgen/tests/headers/virtual_inheritance.hpp deleted file mode 100644 index 5198c51e..00000000 --- a/libbindgen/tests/headers/virtual_inheritance.hpp +++ /dev/null @@ -1,16 +0,0 @@ - -class A { - int foo; -}; - -class B: public virtual A { - int bar; -}; - -class C: public virtual A { - int baz; -}; - -class D: public C, public B { - int bazz; -}; diff --git a/libbindgen/tests/headers/virtual_overloaded.hpp b/libbindgen/tests/headers/virtual_overloaded.hpp deleted file mode 100644 index 8aea8a19..00000000 --- a/libbindgen/tests/headers/virtual_overloaded.hpp +++ /dev/null @@ -1,5 +0,0 @@ -class C { -public: - virtual void do_thing(char) { }; - virtual void do_thing(int) { }; -}; diff --git a/libbindgen/tests/headers/vtable_recursive_sig.hpp b/libbindgen/tests/headers/vtable_recursive_sig.hpp deleted file mode 100644 index 8729be00..00000000 --- a/libbindgen/tests/headers/vtable_recursive_sig.hpp +++ /dev/null @@ -1,11 +0,0 @@ -// bindgen-flags: -- -std=c++11 - -class Derived; -class Base { -public: - virtual Derived* AsDerived() { return nullptr; } -}; - -class Derived final : public Base { - virtual Derived* AsDerived() override { return this; } -}; diff --git a/libbindgen/tests/headers/weird_bitfields.hpp b/libbindgen/tests/headers/weird_bitfields.hpp deleted file mode 100644 index 755681c1..00000000 --- a/libbindgen/tests/headers/weird_bitfields.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// bindgen-flags: --no-unstable-rust -// You can guess where this is taken from... -enum nsStyleSVGOpacitySource { - eStyleSVGOpacitySource_Normal, - eStyleSVGOpacitySource_ContextFillOpacity, - eStyleSVGOpacitySource_ContextStrokeOpacity -}; - -class Weird { - unsigned int mStrokeDasharrayLength; - unsigned int bitTest: 16; - unsigned int bitTest2: 15; - unsigned char mClipRule; // [inherited] - unsigned char mColorInterpolation; // [inherited] see nsStyleConsts.h - unsigned char mColorInterpolationFilters; // [inherited] see nsStyleConsts.h - unsigned char mFillRule; // [inherited] see nsStyleConsts.h - unsigned char mImageRendering; // [inherited] see nsStyleConsts.h - unsigned char mPaintOrder; // [inherited] see nsStyleConsts.h - unsigned char mShapeRendering; // [inherited] see nsStyleConsts.h - unsigned char mStrokeLinecap; // [inherited] see nsStyleConsts.h - unsigned char mStrokeLinejoin; // [inherited] see nsStyleConsts.h - unsigned char mTextAnchor; // [inherited] see nsStyleConsts.h - unsigned char mTextRendering; // [inherited] see nsStyleConsts.h - - // In SVG glyphs, whether we inherit fill or stroke opacity from the outer - // text object. - // Use 3 bits to avoid signedness problems in MSVC. - nsStyleSVGOpacitySource mFillOpacitySource : 3; - nsStyleSVGOpacitySource mStrokeOpacitySource : 3; - - // SVG glyph outer object inheritance for other properties - bool mStrokeDasharrayFromObject : 1; - bool mStrokeDashoffsetFromObject : 1; - bool mStrokeWidthFromObject : 1; -}; diff --git a/libbindgen/tests/headers/what_is_going_on.hpp b/libbindgen/tests/headers/what_is_going_on.hpp deleted file mode 100644 index 078c1ad5..00000000 --- a/libbindgen/tests/headers/what_is_going_on.hpp +++ /dev/null @@ -1,19 +0,0 @@ - -struct UnknownUnits {}; -typedef float Float; - -template<class units, class F = Float> -struct PointTyped { - F x; - F y; - - static PointTyped<units, F> FromUnknownPoint(const PointTyped<UnknownUnits, F>& aPoint) { - return PointTyped<units, F>(aPoint.x, aPoint.y); - } - - PointTyped<UnknownUnits, F> ToUnknownPoint() const { - return PointTyped<UnknownUnits, F>(this->x, this->y); - } -}; - -typedef PointTyped<UnknownUnits> IntPoint; diff --git a/libbindgen/tests/headers/whitelist-namespaces-basic.hpp b/libbindgen/tests/headers/whitelist-namespaces-basic.hpp deleted file mode 100644 index 2eaa8740..00000000 --- a/libbindgen/tests/headers/whitelist-namespaces-basic.hpp +++ /dev/null @@ -1,10 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces --whitelist-type outer::inner::Helper - -namespace outer { - namespace inner { - struct Helper {}; - } - struct Test { - inner::Helper helper; - }; -} diff --git a/libbindgen/tests/headers/whitelist-namespaces.hpp b/libbindgen/tests/headers/whitelist-namespaces.hpp deleted file mode 100644 index d34cbe94..00000000 --- a/libbindgen/tests/headers/whitelist-namespaces.hpp +++ /dev/null @@ -1,10 +0,0 @@ -// bindgen-flags: --enable-cxx-namespaces --whitelist-type '.*' - -namespace outer { - namespace inner { - struct Helper {}; - } - struct Test { - inner::Helper helper; - }; -} diff --git a/libbindgen/tests/headers/whitelist_basic.hpp b/libbindgen/tests/headers/whitelist_basic.hpp deleted file mode 100644 index 8424f75a..00000000 --- a/libbindgen/tests/headers/whitelist_basic.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// bindgen-flags: --whitelist-type WhitelistMe - -template<typename T> -class WhitelistMe { - class Inner { - T bar; - }; - - int foo; - Inner bar; -}; - -struct DontWhitelistMe { - void* foo; - double _Complex noComplexGenerated; -}; diff --git a/libbindgen/tests/headers/whitelist_fix.hpp b/libbindgen/tests/headers/whitelist_fix.hpp deleted file mode 100644 index d0abda54..00000000 --- a/libbindgen/tests/headers/whitelist_fix.hpp +++ /dev/null @@ -1,4 +0,0 @@ -// bindgen-flags: --whitelist-function 'Servo_.*' --blacklist-type Test --raw-line "pub enum Test {}" - -struct Test {}; -extern "C" void Servo_Test(Test* a); diff --git a/libbindgen/tests/headers/whitelist_vars.h b/libbindgen/tests/headers/whitelist_vars.h deleted file mode 100644 index 07fa2815..00000000 --- a/libbindgen/tests/headers/whitelist_vars.h +++ /dev/null @@ -1,4 +0,0 @@ -#define NONE 0 -#define FOO 5 -#define FOOB -2 -#define FOOBAR (-10) diff --git a/libbindgen/tests/tests.rs b/libbindgen/tests/tests.rs deleted file mode 100644 index 01430879..00000000 --- a/libbindgen/tests/tests.rs +++ /dev/null @@ -1,139 +0,0 @@ -extern crate clap; -extern crate diff; -extern crate libbindgen; -extern crate shlex; - -use std::fs; -use std::io::{BufRead, BufReader, Error, ErrorKind, Read, Write}; -use std::path::PathBuf; - -#[path="../../bindgen/src/options.rs"] -mod options; -use options::builder_from_flags; - -fn compare_generated_header(header: &PathBuf, - builder: libbindgen::Builder) - -> Result<(), Error> { - let file_name = try!(header.file_name() - .ok_or(Error::new(ErrorKind::Other, "spawn_bindgen expects a file"))); - - let mut expected = PathBuf::from(header); - expected.pop(); - expected.pop(); - expected.push("expectations"); - expected.push("tests"); - expected.push(file_name); - expected.set_extension("rs"); - - // We skip the generate() error here so we get a full diff below - let output = match builder.generate() { - Ok(bindings) => bindings.to_string(), - Err(_) => "".to_string(), - }; - - let mut buffer = String::new(); - { - if let Ok(expected_file) = fs::File::open(&expected) { - try!(BufReader::new(expected_file).read_to_string(&mut buffer)); - } - } - - if output == buffer { - if !output.is_empty() { - return Ok(()); - } - return Err(Error::new(ErrorKind::Other, - "Something's gone really wrong!")); - } - - println!("diff expected generated"); - println!("--- expected: {:?}", expected); - println!("+++ generated from: {:?}", header); - - for diff in diff::lines(&buffer, &output) { - match diff { - diff::Result::Left(l) => println!("-{}", l), - diff::Result::Both(l, _) => println!(" {}", l), - diff::Result::Right(r) => println!("+{}", r), - } - } - - // Override the diff. - { - let mut expected_file = try!(fs::File::create(&expected)); - try!(expected_file.write_all(output.as_bytes())); - } - - Err(Error::new(ErrorKind::Other, "Header and binding differ!")) -} - -fn create_bindgen_builder(header: &PathBuf) - -> Result<Option<libbindgen::Builder>, Error> { - let source = try!(fs::File::open(header)); - let reader = BufReader::new(source); - - // Scoop up bindgen-flags from test header - let mut flags = Vec::with_capacity(2); - - for line in reader.lines().take(2) { - let line = try!(line); - if line.contains("bindgen-flags: ") { - let extra_flags = line.split("bindgen-flags: ") - .last() - .and_then(shlex::split) - .unwrap(); - flags.extend(extra_flags.into_iter()); - } else if line.contains("bindgen-unstable") && - cfg!(feature = "llvm_stable") { - return Ok(None); - } - } - - // Fool builder_from_flags() into believing it has real env::args_os... - // - add "bindgen" as executable name 0th element - // - add header filename as 1st element - // - prepend raw lines so they're in the right order for expected output - // - append the test header's bindgen flags - let header_str = try!(header.to_str() - .ok_or(Error::new(ErrorKind::Other, "Invalid header file name"))); - - let prepend = ["bindgen", - header_str, - "--raw-line", - "", - "--raw-line", - "#![allow(non_snake_case)]", - "--raw-line", - ""]; - - let args = prepend.into_iter() - .map(ToString::to_string) - .chain(flags.into_iter()); - - builder_from_flags(args) - .map(|(builder, _)| Some(builder.no_unstable_rust())) -} - -macro_rules! test_header { - ($function:ident, $header:expr) => ( - #[test] - fn $function() { - let header = PathBuf::from($header); - let result = create_bindgen_builder(&header) - .and_then(|builder| { - if let Some(builder) = builder { - compare_generated_header(&header, builder) - } else { - Ok(()) - } - }); - - if let Err(err) = result { - panic!("{}", err); - } - } - ) -} - -// This file is generated by build.rs -include!(concat!(env!("OUT_DIR"), "/tests.rs")); diff --git a/libbindgen/tests/uses/.gitignore b/libbindgen/tests/uses/.gitignore deleted file mode 100644 index 40d7cb4c..00000000 --- a/libbindgen/tests/uses/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.c -*.cpp |