summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2020-05-05 11:43:43 +0200
committerGitHub <noreply@github.com>2020-05-05 11:43:43 +0200
commitee2f289a2d57e4d67fe38d060f0c93e9ab866183 (patch)
tree1b0fa35b09107e4912413f0cfb985b7a05f4be43 /tests
parentd5cdad2b55300b2dea111a37fc21e589ff9d5c67 (diff)
parentb9eefb6da7ded8eb688f76fc98469c869d404905 (diff)
Merge pull request #1775 from immunant/blacklist_method_impl
Do not emit Rust method wrapper for blacklisted functions
Diffstat (limited to 'tests')
-rw-r--r--tests/expectations/tests/blacklist-function.rs18
-rw-r--r--tests/headers/blacklist-function.hpp7
2 files changed, 24 insertions, 1 deletions
diff --git a/tests/expectations/tests/blacklist-function.rs b/tests/expectations/tests/blacklist-function.rs
index b1d55643..5c4e8497 100644
--- a/tests/expectations/tests/blacklist-function.rs
+++ b/tests/expectations/tests/blacklist-function.rs
@@ -23,4 +23,22 @@ pub mod root {
pub fn NamespacedFunction();
}
}
+ #[repr(C)]
+ #[derive(Debug, Default, Copy, Clone)]
+ pub struct C {
+ pub _address: u8,
+ }
+ #[test]
+ fn bindgen_test_layout_C() {
+ assert_eq!(
+ ::std::mem::size_of::<C>(),
+ 1usize,
+ concat!("Size of: ", stringify!(C))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<C>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(C))
+ );
+ }
}
diff --git a/tests/headers/blacklist-function.hpp b/tests/headers/blacklist-function.hpp
index c4a923fc..8087295c 100644
--- a/tests/headers/blacklist-function.hpp
+++ b/tests/headers/blacklist-function.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --blacklist-function "ExternFunction" --blacklist-function "foo::NamespacedFunction" --enable-cxx-namespaces
+// bindgen-flags: --blacklist-function "ExternFunction" --blacklist-function "foo::NamespacedFunction" --blacklist-function "C_ClassMethod" --enable-cxx-namespaces
extern "C" void ExternFunction();
@@ -9,3 +9,8 @@ namespace foo {
namespace bar {
void NamespacedFunction();
}
+
+class C {
+public:
+ void ClassMethod();
+};