diff options
author | Xidorn Quan <me@upsuper.org> | 2016-10-25 20:05:15 +1100 |
---|---|---|
committer | Xidorn Quan <me@upsuper.org> | 2016-10-25 23:45:31 +1100 |
commit | 48f0059627bd73fb6ab7189edd651678a35dfe32 (patch) | |
tree | e90bbe38f1eee5eb800b6ab86c74b0fd86b43ba9 | |
parent | f798f6536da5ad7e5d850dff2e4546f5aac78cbb (diff) |
Add test for static const
-rw-r--r-- | tests/expectations/class_static_const.rs | 22 | ||||
-rw-r--r-- | tests/headers/class_static_const.hpp | 8 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/expectations/class_static_const.rs b/tests/expectations/class_static_const.rs new file mode 100644 index 00000000..eed6590c --- /dev/null +++ b/tests/expectations/class_static_const.rs @@ -0,0 +1,22 @@ +/* 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/tests/headers/class_static_const.hpp b/tests/headers/class_static_const.hpp new file mode 100644 index 00000000..150afe8b --- /dev/null +++ b/tests/headers/class_static_const.hpp @@ -0,0 +1,8 @@ +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; +}; |