diff options
Diffstat (limited to 'tests/expectations')
-rw-r--r-- | tests/expectations/tests/no-hash-opaque.rs | 24 | ||||
-rw-r--r-- | tests/expectations/tests/no-hash-whitelisted.rs | 34 | ||||
-rw-r--r-- | tests/expectations/tests/whitelisted-item-references-no-hash.rs | 52 |
3 files changed, 110 insertions, 0 deletions
diff --git a/tests/expectations/tests/no-hash-opaque.rs b/tests/expectations/tests/no-hash-opaque.rs new file mode 100644 index 00000000..c4211c71 --- /dev/null +++ b/tests/expectations/tests/no-hash-opaque.rs @@ -0,0 +1,24 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] + + +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct NoHash { + pub _bindgen_opaque_blob: u32, +} +#[test] +fn bindgen_test_layout_NoHash() { + assert_eq!( + ::std::mem::size_of::<NoHash>(), + 4usize, + concat!("Size of: ", stringify!(NoHash)) + ); + assert_eq!( + ::std::mem::align_of::<NoHash>(), + 4usize, + concat!("Alignment of ", stringify!(NoHash)) + ); +} diff --git a/tests/expectations/tests/no-hash-whitelisted.rs b/tests/expectations/tests/no-hash-whitelisted.rs new file mode 100644 index 00000000..9997d062 --- /dev/null +++ b/tests/expectations/tests/no-hash-whitelisted.rs @@ -0,0 +1,34 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] + + +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct NoHash { + pub i: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_NoHash() { + assert_eq!( + ::std::mem::size_of::<NoHash>(), + 4usize, + concat!("Size of: ", stringify!(NoHash)) + ); + assert_eq!( + ::std::mem::align_of::<NoHash>(), + 4usize, + concat!("Alignment of ", stringify!(NoHash)) + ); + assert_eq!( + unsafe { &(*(0 as *const NoHash)).i as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(NoHash), + "::", + stringify!(i) + ) + ); +} diff --git a/tests/expectations/tests/whitelisted-item-references-no-hash.rs b/tests/expectations/tests/whitelisted-item-references-no-hash.rs new file mode 100644 index 00000000..5a77ff75 --- /dev/null +++ b/tests/expectations/tests/whitelisted-item-references-no-hash.rs @@ -0,0 +1,52 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] + + +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct NoHash { + pub _address: u8, +} +#[test] +fn bindgen_test_layout_NoHash() { + assert_eq!( + ::std::mem::size_of::<NoHash>(), + 1usize, + concat!("Size of: ", stringify!(NoHash)) + ); + assert_eq!( + ::std::mem::align_of::<NoHash>(), + 1usize, + concat!("Alignment of ", stringify!(NoHash)) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct WhitelistMe { + pub a: NoHash, +} +#[test] +fn bindgen_test_layout_WhitelistMe() { + assert_eq!( + ::std::mem::size_of::<WhitelistMe>(), + 1usize, + concat!("Size of: ", stringify!(WhitelistMe)) + ); + assert_eq!( + ::std::mem::align_of::<WhitelistMe>(), + 1usize, + concat!("Alignment of ", stringify!(WhitelistMe)) + ); + assert_eq!( + unsafe { &(*(0 as *const WhitelistMe)).a as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(WhitelistMe), + "::", + stringify!(a) + ) + ); +} |