summaryrefslogtreecommitdiff
path: root/libbindgen
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2017-01-23 10:13:18 -0800
committerNick Fitzgerald <fitzgen@gmail.com>2017-01-23 10:13:18 -0800
commit5c7030903774bdde07934718f6b184ff9db2c6de (patch)
tree28f77d11a923fb1c206dae87a7c4db0c26bc6638 /libbindgen
parentf347ce2ddc7f18a05205b8243ac5d0a61b69f9f1 (diff)
Move new test files out of libbindgen
Diffstat (limited to 'libbindgen')
-rw-r--r--libbindgen/tests/expectations/tests/16-byte-alignment.rs136
-rw-r--r--libbindgen/tests/expectations/tests/issue-410.rs41
-rw-r--r--libbindgen/tests/headers/16-byte-alignment.h33
-rw-r--r--libbindgen/tests/headers/issue-410.hpp12
4 files changed, 0 insertions, 222 deletions
diff --git a/libbindgen/tests/expectations/tests/16-byte-alignment.rs b/libbindgen/tests/expectations/tests/16-byte-alignment.rs
deleted file mode 100644
index b28c0537..00000000
--- a/libbindgen/tests/expectations/tests/16-byte-alignment.rs
+++ /dev/null
@@ -1,136 +0,0 @@
-/* automatically generated by rust-bindgen */
-
-
-#![allow(non_snake_case)]
-
-
-#[repr(C)]
-pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
-impl <T> __BindgenUnionField<T> {
- #[inline]
- pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
- #[inline]
- pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
- #[inline]
- pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
-}
-impl <T> ::std::default::Default for __BindgenUnionField<T> {
- #[inline]
- fn default() -> Self { Self::new() }
-}
-impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
- #[inline]
- fn clone(&self) -> Self { Self::new() }
-}
-impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
-impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
- fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- fmt.write_str("__BindgenUnionField")
- }
-}
-#[repr(C)]
-#[derive(Debug, Copy)]
-pub struct rte_ipv4_tuple {
- pub src_addr: u32,
- pub dst_addr: u32,
- pub __bindgen_anon_1: rte_ipv4_tuple__bindgen_ty_1,
-}
-#[repr(C)]
-#[derive(Debug, Copy)]
-pub struct rte_ipv4_tuple__bindgen_ty_1 {
- pub __bindgen_anon_1: __BindgenUnionField<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>,
- pub sctp_tag: __BindgenUnionField<u32>,
- pub bindgen_union_field: u32,
-}
-#[repr(C)]
-#[derive(Debug, Copy)]
-pub struct rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1 {
- pub dport: u16,
- pub sport: u16,
-}
-#[test]
-fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>()
- , 4usize);
- assert_eq!(::std::mem::align_of::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>()
- , 2usize);
-}
-impl Clone for rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
-}
-#[test]
-fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_ipv4_tuple__bindgen_ty_1>() ,
- 4usize);
- assert_eq!(::std::mem::align_of::<rte_ipv4_tuple__bindgen_ty_1>() ,
- 4usize);
-}
-impl Clone for rte_ipv4_tuple__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
-}
-#[test]
-fn bindgen_test_layout_rte_ipv4_tuple() {
- assert_eq!(::std::mem::size_of::<rte_ipv4_tuple>() , 12usize);
- assert_eq!(::std::mem::align_of::<rte_ipv4_tuple>() , 4usize);
-}
-impl Clone for rte_ipv4_tuple {
- fn clone(&self) -> Self { *self }
-}
-#[repr(C)]
-#[derive(Debug, Copy)]
-pub struct rte_ipv6_tuple {
- pub src_addr: [u8; 16usize],
- pub dst_addr: [u8; 16usize],
- pub __bindgen_anon_1: rte_ipv6_tuple__bindgen_ty_1,
-}
-#[repr(C)]
-#[derive(Debug, Copy)]
-pub struct rte_ipv6_tuple__bindgen_ty_1 {
- pub __bindgen_anon_1: __BindgenUnionField<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>,
- pub sctp_tag: __BindgenUnionField<u32>,
- pub bindgen_union_field: u32,
-}
-#[repr(C)]
-#[derive(Debug, Copy)]
-pub struct rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1 {
- pub dport: u16,
- pub sport: u16,
-}
-#[test]
-fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>()
- , 4usize);
- assert_eq!(::std::mem::align_of::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>()
- , 2usize);
-}
-impl Clone for rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
-}
-#[test]
-fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_ipv6_tuple__bindgen_ty_1>() ,
- 4usize);
- assert_eq!(::std::mem::align_of::<rte_ipv6_tuple__bindgen_ty_1>() ,
- 4usize);
-}
-impl Clone for rte_ipv6_tuple__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
-}
-#[test]
-fn bindgen_test_layout_rte_ipv6_tuple() {
- assert_eq!(::std::mem::size_of::<rte_ipv6_tuple>() , 36usize);
- assert_eq!(::std::mem::align_of::<rte_ipv6_tuple>() , 4usize);
-}
-impl Clone for rte_ipv6_tuple {
- fn clone(&self) -> Self { *self }
-}
-#[repr(C)]
-#[derive(Copy)]
-pub struct rte_thash_tuple {
- pub v4: __BindgenUnionField<rte_ipv4_tuple>,
- pub v6: __BindgenUnionField<rte_ipv6_tuple>,
- pub bindgen_union_field: [u8; 48usize],
-}
-impl Clone for rte_thash_tuple {
- fn clone(&self) -> Self { *self }
-}
diff --git a/libbindgen/tests/expectations/tests/issue-410.rs b/libbindgen/tests/expectations/tests/issue-410.rs
deleted file mode 100644
index a5d94960..00000000
--- a/libbindgen/tests/expectations/tests/issue-410.rs
+++ /dev/null
@@ -1,41 +0,0 @@
-/* automatically generated by rust-bindgen */
-
-
-#![allow(non_snake_case)]
-
-
-pub mod root {
- #[allow(unused_imports)]
- use self::super::root;
- pub mod JS {
- #[allow(unused_imports)]
- use self::super::super::root;
- pub use root::_bindgen_ty_1 as JSWhyMagic;
- #[repr(C)]
- #[derive(Debug, Copy)]
- pub struct Value {
- pub _address: u8,
- }
- #[test]
- fn bindgen_test_layout_Value() {
- assert_eq!(::std::mem::size_of::<Value>() , 1usize);
- assert_eq!(::std::mem::align_of::<Value>() , 1usize);
- }
- extern "C" {
- #[link_name = "_ZN2JS5Value1aE10JSWhyMagic"]
- pub fn Value_a(this: *mut root::JS::Value,
- arg1: root::JS::JSWhyMagic);
- }
- impl Clone for Value {
- fn clone(&self) -> Self { *self }
- }
- impl Value {
- #[inline]
- pub unsafe fn a(&mut self, arg1: root::JS::JSWhyMagic) {
- Value_a(&mut *self, arg1)
- }
- }
- }
- #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
- pub enum _bindgen_ty_1 { }
-}
diff --git a/libbindgen/tests/headers/16-byte-alignment.h b/libbindgen/tests/headers/16-byte-alignment.h
deleted file mode 100644
index 7a7f7548..00000000
--- a/libbindgen/tests/headers/16-byte-alignment.h
+++ /dev/null
@@ -1,33 +0,0 @@
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-
-struct rte_ipv4_tuple {
- uint32_t src_addr;
- uint32_t dst_addr;
- union {
- struct {
- uint16_t dport;
- uint16_t sport;
- };
- uint32_t sctp_tag;
- };
-};
-
-struct rte_ipv6_tuple {
- uint8_t src_addr[16];
- uint8_t dst_addr[16];
- union {
- struct {
- uint16_t dport;
- uint16_t sport;
- };
- uint32_t sctp_tag;
- };
-};
-
-union rte_thash_tuple {
- struct rte_ipv4_tuple v4;
- struct rte_ipv6_tuple v6;
-} __attribute__((aligned(16)));
diff --git a/libbindgen/tests/headers/issue-410.hpp b/libbindgen/tests/headers/issue-410.hpp
deleted file mode 100644
index a7a834cf..00000000
--- a/libbindgen/tests/headers/issue-410.hpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// bindgen-flags: --enable-cxx-namespaces --whitelist-type JS::Value
-
-namespace JS {
-class Value;
-}
-typedef enum {} JSWhyMagic;
-namespace JS {
-class Value {
-public:
- void a(JSWhyMagic);
-};
-}