Skip to content

Commit b9eefb6

Browse files
committed
Add test
1 parent 1e426ae commit b9eefb6

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

tests/expectations/tests/blacklist-function.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,22 @@ pub mod root {
2323
pub fn NamespacedFunction();
2424
}
2525
}
26+
#[repr(C)]
27+
#[derive(Debug, Default, Copy, Clone)]
28+
pub struct C {
29+
pub _address: u8,
30+
}
31+
#[test]
32+
fn bindgen_test_layout_C() {
33+
assert_eq!(
34+
::std::mem::size_of::<C>(),
35+
1usize,
36+
concat!("Size of: ", stringify!(C))
37+
);
38+
assert_eq!(
39+
::std::mem::align_of::<C>(),
40+
1usize,
41+
concat!("Alignment of ", stringify!(C))
42+
);
43+
}
2644
}

tests/headers/blacklist-function.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bindgen-flags: --blacklist-function "ExternFunction" --blacklist-function "foo::NamespacedFunction" --enable-cxx-namespaces
1+
// bindgen-flags: --blacklist-function "ExternFunction" --blacklist-function "foo::NamespacedFunction" --blacklist-function "C_ClassMethod" --enable-cxx-namespaces
22

33
extern "C" void ExternFunction();
44

@@ -9,3 +9,8 @@ namespace foo {
99
namespace bar {
1010
void NamespacedFunction();
1111
}
12+
13+
class C {
14+
public:
15+
void ClassMethod();
16+
};

0 commit comments

Comments
 (0)