diff options
author | Zhiting Zhu <zhitingz@cs.utexas.edu> | 2017-08-16 21:15:15 -0500 |
---|---|---|
committer | Zhiting Zhu <zhitingz@cs.utexas.edu> | 2017-08-21 16:14:41 -0500 |
commit | 8ed02618a57ead804c58b263f66dd8047c4bc9c6 (patch) | |
tree | 2a99bdfbf08047de86d90e191fad98126107313c | |
parent | 096bc876fcc57177c0c18cfca7321f45e5544b25 (diff) |
Anonymous related tests for derive Eq
-rw-r--r-- | tests/expectations/tests/anon_enum_trait.rs | 4 | ||||
-rw-r--r-- | tests/expectations/tests/anon_struct_in_union.rs | 2 | ||||
-rw-r--r-- | tests/expectations/tests/anon_struct_in_union_1_0.rs | 7 | ||||
-rw-r--r-- | tests/expectations/tests/anon_union.rs | 4 | ||||
-rw-r--r-- | tests/expectations/tests/anon_union_1_0.rs | 11 | ||||
-rw-r--r-- | tests/headers/anon_enum.hpp | 2 | ||||
-rw-r--r-- | tests/headers/anon_enum_trait.hpp | 2 | ||||
-rw-r--r-- | tests/headers/anon_struct_in_union.h | 2 | ||||
-rw-r--r-- | tests/headers/anon_struct_in_union_1_0.h | 2 | ||||
-rw-r--r-- | tests/headers/anon_union.hpp | 2 | ||||
-rw-r--r-- | tests/headers/anon_union_1_0.hpp | 2 |
11 files changed, 21 insertions, 19 deletions
diff --git a/tests/expectations/tests/anon_enum_trait.rs b/tests/expectations/tests/anon_enum_trait.rs index c2ae221b..f0c1d364 100644 --- a/tests/expectations/tests/anon_enum_trait.rs +++ b/tests/expectations/tests/anon_enum_trait.rs @@ -5,7 +5,7 @@ #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct DataType { pub _address: u8, } @@ -27,7 +27,7 @@ pub const DataType_type_: DataType__bindgen_ty_1 = #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum DataType__bindgen_ty_1 { generic_type = 0, } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct Foo { pub _address: u8, } diff --git a/tests/expectations/tests/anon_struct_in_union.rs b/tests/expectations/tests/anon_struct_in_union.rs index 9dbf30de..783a62cf 100644 --- a/tests/expectations/tests/anon_struct_in_union.rs +++ b/tests/expectations/tests/anon_struct_in_union.rs @@ -16,7 +16,7 @@ pub union s__bindgen_ty_1 { _bindgen_union_align: u32, } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct s__bindgen_ty_1_inner { pub b: ::std::os::raw::c_int, } diff --git a/tests/expectations/tests/anon_struct_in_union_1_0.rs b/tests/expectations/tests/anon_struct_in_union_1_0.rs index 74b6fe4a..8c29f8e4 100644 --- a/tests/expectations/tests/anon_struct_in_union_1_0.rs +++ b/tests/expectations/tests/anon_struct_in_union_1_0.rs @@ -34,19 +34,20 @@ impl <T> ::std::hash::Hash for __BindgenUnionField<T> { impl <T> ::std::cmp::PartialEq for __BindgenUnionField<T> { fn eq(&self, _other: &__BindgenUnionField<T>) -> bool { true } } +impl <T> ::std::cmp::Eq for __BindgenUnionField<T> { } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct s { pub u: s__bindgen_ty_1, } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct s__bindgen_ty_1 { pub field: __BindgenUnionField<s__bindgen_ty_1_inner>, pub bindgen_union_field: u32, } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct s__bindgen_ty_1_inner { pub b: ::std::os::raw::c_int, } diff --git a/tests/expectations/tests/anon_union.rs b/tests/expectations/tests/anon_union.rs index a055cbe5..f2da118d 100644 --- a/tests/expectations/tests/anon_union.rs +++ b/tests/expectations/tests/anon_union.rs @@ -17,12 +17,12 @@ pub const TErrorResult_UnionState_HasException: TErrorResult_UnionState = #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum TErrorResult_UnionState { HasMessage = 0, } #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct TErrorResult_Message { pub _address: u8, } #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct TErrorResult_DOMExceptionInfo { pub _address: u8, } diff --git a/tests/expectations/tests/anon_union_1_0.rs b/tests/expectations/tests/anon_union_1_0.rs index 64a17776..b96928d4 100644 --- a/tests/expectations/tests/anon_union_1_0.rs +++ b/tests/expectations/tests/anon_union_1_0.rs @@ -34,8 +34,9 @@ impl <T> ::std::hash::Hash for __BindgenUnionField<T> { impl <T> ::std::cmp::PartialEq for __BindgenUnionField<T> { fn eq(&self, _other: &__BindgenUnionField<T>) -> bool { true } } +impl <T> ::std::cmp::Eq for __BindgenUnionField<T> { } #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct TErrorResult { pub mResult: ::std::os::raw::c_int, pub __bindgen_anon_1: TErrorResult__bindgen_ty_1, @@ -48,17 +49,17 @@ pub const TErrorResult_UnionState_HasException: TErrorResult_UnionState = #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum TErrorResult_UnionState { HasMessage = 0, } #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct TErrorResult_Message { pub _address: u8, } #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct TErrorResult_DOMExceptionInfo { pub _address: u8, } #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct TErrorResult__bindgen_ty_1 { pub mMessage: __BindgenUnionField<*mut TErrorResult_Message>, pub mDOMExceptionInfo: __BindgenUnionField<*mut TErrorResult_DOMExceptionInfo>, @@ -68,7 +69,7 @@ impl Default for TErrorResult { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Hash, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct ErrorResult { pub _base: TErrorResult, } diff --git a/tests/headers/anon_enum.hpp b/tests/headers/anon_enum.hpp index 48df3c7a..3e8ff3d4 100644 --- a/tests/headers/anon_enum.hpp +++ b/tests/headers/anon_enum.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq struct Test { int foo; float bar; diff --git a/tests/headers/anon_enum_trait.hpp b/tests/headers/anon_enum_trait.hpp index 7d164054..865411e2 100644 --- a/tests/headers/anon_enum_trait.hpp +++ b/tests/headers/anon_enum_trait.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq template<typename _Tp> class DataType { diff --git a/tests/headers/anon_struct_in_union.h b/tests/headers/anon_struct_in_union.h index 98d55056..2587ede5 100644 --- a/tests/headers/anon_struct_in_union.h +++ b/tests/headers/anon_struct_in_union.h @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq struct s { union { struct inner { diff --git a/tests/headers/anon_struct_in_union_1_0.h b/tests/headers/anon_struct_in_union_1_0.h index 86e5ca73..6b59723a 100644 --- a/tests/headers/anon_struct_in_union_1_0.h +++ b/tests/headers/anon_struct_in_union_1_0.h @@ -1,4 +1,4 @@ -// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq +// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq --with-derive-eq struct s { union { diff --git a/tests/headers/anon_union.hpp b/tests/headers/anon_union.hpp index ca1d3bc1..8e649abb 100644 --- a/tests/headers/anon_union.hpp +++ b/tests/headers/anon_union.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq template<typename T> struct TErrorResult { enum UnionState { diff --git a/tests/headers/anon_union_1_0.hpp b/tests/headers/anon_union_1_0.hpp index 1a5e2b0d..699efa32 100644 --- a/tests/headers/anon_union_1_0.hpp +++ b/tests/headers/anon_union_1_0.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq +// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq --with-derive-eq template<typename T> struct TErrorResult { |