diff options
-rw-r--r-- | tests/expectations/tests/do-not-derive-copy.rs | 28 | ||||
-rw-r--r-- | tests/headers/do-not-derive-copy.hpp | 5 |
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/expectations/tests/do-not-derive-copy.rs b/tests/expectations/tests/do-not-derive-copy.rs new file mode 100644 index 00000000..114b73e3 --- /dev/null +++ b/tests/expectations/tests/do-not-derive-copy.rs @@ -0,0 +1,28 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] + + +#[repr(C)] +#[derive(Debug, Default)] +pub struct WouldBeCopyButWeAreNotDerivingCopy { + pub x: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_WouldBeCopyButWeAreNotDerivingCopy() { + assert_eq!(::std::mem::size_of::<WouldBeCopyButWeAreNotDerivingCopy>() , + 4usize , concat ! ( + "Size of: " , stringify ! ( WouldBeCopyButWeAreNotDerivingCopy + ) )); + assert_eq! (::std::mem::align_of::<WouldBeCopyButWeAreNotDerivingCopy>() , + 4usize , concat ! ( + "Alignment of " , stringify ! ( + WouldBeCopyButWeAreNotDerivingCopy ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const WouldBeCopyButWeAreNotDerivingCopy ) ) . + x as * const _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( + WouldBeCopyButWeAreNotDerivingCopy ) , "::" , stringify ! ( x + ) )); +} diff --git a/tests/headers/do-not-derive-copy.hpp b/tests/headers/do-not-derive-copy.hpp new file mode 100644 index 00000000..18c26135 --- /dev/null +++ b/tests/headers/do-not-derive-copy.hpp @@ -0,0 +1,5 @@ +// bindgen-flags: --no-derive-copy + +class WouldBeCopyButWeAreNotDerivingCopy { + int x; +}; |