From 7a392534d180afdbaec9955ae3afd45a4196812a Mon Sep 17 00:00:00 2001 From: Ravi Shankar Date: Tue, 4 Oct 2016 08:32:24 +0530 Subject: Add test for 'int' in whitelist_vars and regen test expectations --- tests/expectations/jsval_layout_opaque.rs | 39 ++++++++++++++++--------------- tests/expectations/whitelist_vars.rs | 10 ++++++++ tests/headers/whitelist_vars.h | 4 ++++ 3 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 tests/expectations/whitelist_vars.rs create mode 100644 tests/headers/whitelist_vars.h diff --git a/tests/expectations/jsval_layout_opaque.rs b/tests/expectations/jsval_layout_opaque.rs index dd432232..dc0ecad5 100644 --- a/tests/expectations/jsval_layout_opaque.rs +++ b/tests/expectations/jsval_layout_opaque.rs @@ -24,6 +24,7 @@ impl ::std::clone::Clone for __BindgenUnionField { fn clone(&self) -> Self { Self::new() } } impl ::std::marker::Copy for __BindgenUnionField { } +pub const JSVAL_ALIGNMENT: ::std::os::raw::c_uint = 8; pub const JSVAL_TAG_SHIFT: ::std::os::raw::c_uint = 47; #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -93,8 +94,8 @@ pub enum JSWhyMagic { #[derive(Debug, Copy)] pub struct jsval_layout { pub asBits: __BindgenUnionField, - pub debugView: __BindgenUnionField, - pub s: __BindgenUnionField, + pub debugView: __BindgenUnionField, + pub s: __BindgenUnionField, pub asDouble: __BindgenUnionField, pub asPtr: __BindgenUnionField<*mut ::std::os::raw::c_void>, pub asWord: __BindgenUnionField, @@ -103,20 +104,20 @@ pub struct jsval_layout { } #[repr(C)] #[derive(Debug, Copy)] -pub struct jsval_layout__bindgen_ty_bindgen_id_89 { +pub struct jsval_layout__bindgen_ty_bindgen_id_90 { pub _bitfield_1: u64, } #[test] -fn bindgen_test_layout_jsval_layout__bindgen_ty_bindgen_id_89() { - assert_eq!(::std::mem::size_of::() +fn bindgen_test_layout_jsval_layout__bindgen_ty_bindgen_id_90() { + assert_eq!(::std::mem::size_of::() , 8usize); - assert_eq!(::std::mem::align_of::() + assert_eq!(::std::mem::align_of::() , 8usize); } -impl Clone for jsval_layout__bindgen_ty_bindgen_id_89 { +impl Clone for jsval_layout__bindgen_ty_bindgen_id_90 { fn clone(&self) -> Self { *self } } -impl jsval_layout__bindgen_ty_bindgen_id_89 { +impl jsval_layout__bindgen_ty_bindgen_id_90 { #[inline] pub fn payload47(&self) -> u64 { unsafe { @@ -149,36 +150,36 @@ impl jsval_layout__bindgen_ty_bindgen_id_89 { } #[repr(C)] #[derive(Debug, Copy)] -pub struct jsval_layout__bindgen_ty_bindgen_id_96 { - pub payload: jsval_layout__bindgen_ty_bindgen_id_96__bindgen_ty_bindgen_id_97, +pub struct jsval_layout__bindgen_ty_bindgen_id_97 { + pub payload: jsval_layout__bindgen_ty_bindgen_id_97__bindgen_ty_bindgen_id_98, } #[repr(C)] #[derive(Debug, Copy)] -pub struct jsval_layout__bindgen_ty_bindgen_id_96__bindgen_ty_bindgen_id_97 { +pub struct jsval_layout__bindgen_ty_bindgen_id_97__bindgen_ty_bindgen_id_98 { pub i32: __BindgenUnionField, pub u32: __BindgenUnionField, pub why: __BindgenUnionField, pub bindgen_union_field: u32, } #[test] -fn bindgen_test_layout_jsval_layout__bindgen_ty_bindgen_id_96__bindgen_ty_bindgen_id_97() { - assert_eq!(::std::mem::size_of::() +fn bindgen_test_layout_jsval_layout__bindgen_ty_bindgen_id_97__bindgen_ty_bindgen_id_98() { + assert_eq!(::std::mem::size_of::() , 4usize); - assert_eq!(::std::mem::align_of::() + assert_eq!(::std::mem::align_of::() , 4usize); } impl Clone for - jsval_layout__bindgen_ty_bindgen_id_96__bindgen_ty_bindgen_id_97 { + jsval_layout__bindgen_ty_bindgen_id_97__bindgen_ty_bindgen_id_98 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_jsval_layout__bindgen_ty_bindgen_id_96() { - assert_eq!(::std::mem::size_of::() +fn bindgen_test_layout_jsval_layout__bindgen_ty_bindgen_id_97() { + assert_eq!(::std::mem::size_of::() , 4usize); - assert_eq!(::std::mem::align_of::() + assert_eq!(::std::mem::align_of::() , 4usize); } -impl Clone for jsval_layout__bindgen_ty_bindgen_id_96 { +impl Clone for jsval_layout__bindgen_ty_bindgen_id_97 { fn clone(&self) -> Self { *self } } impl Clone for jsval_layout { diff --git a/tests/expectations/whitelist_vars.rs b/tests/expectations/whitelist_vars.rs new file mode 100644 index 00000000..f7af24b2 --- /dev/null +++ b/tests/expectations/whitelist_vars.rs @@ -0,0 +1,10 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + +pub const NONE: ::std::os::raw::c_uint = 0; +pub const FOO: ::std::os::raw::c_uint = 5; +pub const FOOB: ::std::os::raw::c_int = -2; +pub const FOOBAR: ::std::os::raw::c_int = -10; diff --git a/tests/headers/whitelist_vars.h b/tests/headers/whitelist_vars.h new file mode 100644 index 00000000..07fa2815 --- /dev/null +++ b/tests/headers/whitelist_vars.h @@ -0,0 +1,4 @@ +#define NONE 0 +#define FOO 5 +#define FOOB -2 +#define FOOBAR (-10) -- cgit v1.2.3