Skip to content

Commit ab6b6f4

Browse files
committed
Add expected output for constified module enum test
1 parent 570e767 commit ab6b6f4

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
5+
6+
7+
pub mod foo {
8+
pub type Type = ::std::os::raw::c_uint;
9+
pub const THIS: Type = 0;
10+
pub const SHOULD_BE: Type = 1;
11+
pub const A_CONSTANT: Type = 2;
12+
}
13+
#[repr(C)]
14+
#[derive(Debug, Copy)]
15+
pub struct bar {
16+
pub this_should_work: foo::Type,
17+
}
18+
#[test]
19+
fn bindgen_test_layout_bar() {
20+
assert_eq!(::std::mem::size_of::<bar>() , 4usize , concat ! (
21+
"Size of: " , stringify ! ( bar ) ));
22+
assert_eq! (::std::mem::align_of::<bar>() , 4usize , concat ! (
23+
"Alignment of " , stringify ! ( bar ) ));
24+
assert_eq! (unsafe {
25+
& ( * ( 0 as * const bar ) ) . this_should_work as * const _
26+
as usize } , 0usize , concat ! (
27+
"Alignment of field: " , stringify ! ( bar ) , "::" ,
28+
stringify ! ( this_should_work ) ));
29+
}
30+
impl Clone for bar {
31+
fn clone(&self) -> Self { *self }
32+
}
33+
impl Default for bar {
34+
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
35+
}

0 commit comments

Comments
 (0)