summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZhiting Zhu <zzhu@mozilla.com>2017-08-11 11:20:23 -0700
committerZhiting Zhu <zzhu@mozilla.com>2017-08-14 10:19:14 -0700
commit93e7ccdd9a978e4b05fc171bfe0ff8952aa0b406 (patch)
treec94e9bf59104c2892d60317bfad54800d4254a1e /tests
parent3e5b9de1b9eeab0c35d88e14f4cc02ad0c79aa29 (diff)
Template related tests for derive PartialEq
Diffstat (limited to 'tests')
-rw-r--r--tests/expectations/tests/anonymous-template-types.rs8
-rw-r--r--tests/expectations/tests/empty_template_param_name.rs2
-rw-r--r--tests/expectations/tests/template-fun-ty.rs6
-rw-r--r--tests/expectations/tests/template.rs42
-rw-r--r--tests/expectations/tests/template_alias.rs2
-rw-r--r--tests/expectations/tests/template_alias_namespace.rs2
-rw-r--r--tests/expectations/tests/template_typedef_transitive_param.rs4
-rw-r--r--tests/expectations/tests/templateref_opaque.rs4
-rw-r--r--tests/headers/anonymous-template-types.hpp2
-rw-r--r--tests/headers/empty_template_param_name.hpp2
-rw-r--r--tests/headers/template-fun-ty.hpp2
-rw-r--r--tests/headers/template.hpp2
-rw-r--r--tests/headers/template_alias.hpp2
-rw-r--r--tests/headers/template_alias_namespace.hpp2
-rw-r--r--tests/headers/template_typedef_transitive_param.hpp2
-rw-r--r--tests/headers/templateref_opaque.hpp2
16 files changed, 43 insertions, 43 deletions
diff --git a/tests/expectations/tests/anonymous-template-types.rs b/tests/expectations/tests/anonymous-template-types.rs
index 6d231330..cc682751 100644
--- a/tests/expectations/tests/anonymous-template-types.rs
+++ b/tests/expectations/tests/anonymous-template-types.rs
@@ -5,7 +5,7 @@
#[repr(C)]
-#[derive(Debug, Copy, Clone, Hash)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct Foo<T> {
pub t_member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -14,12 +14,12 @@ impl <T> Default for Foo<T> {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
pub struct Bar {
pub member: ::std::os::raw::c_char,
}
#[repr(C)]
-#[derive(Debug, Copy, Clone, Hash)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct Quux<V> {
pub v_member: V,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<V>>,
@@ -28,7 +28,7 @@ impl <V> Default for Quux<V> {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
pub struct Lobo {
pub also_member: ::std::os::raw::c_char,
}
diff --git a/tests/expectations/tests/empty_template_param_name.rs b/tests/expectations/tests/empty_template_param_name.rs
index 07f27e54..aff9d14d 100644
--- a/tests/expectations/tests/empty_template_param_name.rs
+++ b/tests/expectations/tests/empty_template_param_name.rs
@@ -6,7 +6,7 @@
pub type __void_t = ::std::os::raw::c_void;
#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
pub struct __iterator_traits {
pub _address: u8,
}
diff --git a/tests/expectations/tests/template-fun-ty.rs b/tests/expectations/tests/template-fun-ty.rs
index a4c8ad44..1cecdada 100644
--- a/tests/expectations/tests/template-fun-ty.rs
+++ b/tests/expectations/tests/template-fun-ty.rs
@@ -5,19 +5,19 @@
#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
pub struct Foo {
pub _address: u8,
}
pub type Foo_FunctionPtr<T> =
::std::option::Option<unsafe extern "C" fn() -> T>;
#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
pub struct RefPtr {
pub _address: u8,
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
pub struct RefPtr_Proxy {
pub _address: u8,
}
diff --git a/tests/expectations/tests/template.rs b/tests/expectations/tests/template.rs
index f2d639b6..ff18874d 100644
--- a/tests/expectations/tests/template.rs
+++ b/tests/expectations/tests/template.rs
@@ -5,7 +5,7 @@
#[repr(C)]
-#[derive(Debug, Hash)]
+#[derive(Debug, Hash, PartialEq)]
pub struct Foo<T> {
pub m_member: T,
pub m_member_ptr: *mut T,
@@ -16,7 +16,7 @@ impl <T> Default for Foo<T> {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Clone, Hash)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct B<T> {
pub m_member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -34,7 +34,7 @@ pub struct mozilla_Foo {
_unused: [u8; 0],
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct C {
pub mB: B<::std::os::raw::c_uint>,
pub mBConstPtr: B<*const ::std::os::raw::c_int>,
@@ -140,13 +140,13 @@ impl Default for C {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Hash)]
+#[derive(Debug, Hash, PartialEq)]
pub struct D {
pub m_foo: D_MyFoo,
}
pub type D_MyFoo = Foo<::std::os::raw::c_int>;
#[repr(C)]
-#[derive(Debug, Hash)]
+#[derive(Debug, Hash, PartialEq)]
pub struct D_U<Z> {
pub m_nested_foo: D_MyFoo,
pub m_baz: Z,
@@ -159,7 +159,7 @@ impl Default for D {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Clone, Hash)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct Rooted<T> {
pub prev: *mut T,
pub next: *mut Rooted<*mut ::std::os::raw::c_void>,
@@ -170,7 +170,7 @@ impl <T> Default for Rooted<T> {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct RootedContainer {
pub root: Rooted<*mut ::std::os::raw::c_void>,
}
@@ -193,7 +193,7 @@ impl Default for RootedContainer {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Hash)]
+#[derive(Debug, Hash, PartialEq)]
pub struct WithDtor<T> {
pub member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -203,7 +203,7 @@ impl <T> Default for WithDtor<T> {
}
pub type WithDtorIntFwd = WithDtor<::std::os::raw::c_int>;
#[repr(C)]
-#[derive(Debug, Hash)]
+#[derive(Debug, Hash, PartialEq)]
pub struct PODButContainsDtor {
pub member: WithDtorIntFwd,
}
@@ -224,11 +224,11 @@ impl Default for PODButContainsDtor {
}
/// <div rustbindgen opaque>
#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
pub struct Opaque {
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct POD {
pub opaque_member: u32,
}
@@ -249,7 +249,7 @@ impl Clone for POD {
}
/// <div rustbindgen replaces="NestedReplaced"></div>
#[repr(C)]
-#[derive(Debug, Copy, Clone, Hash)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct NestedReplaced<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -258,7 +258,7 @@ impl <T> Default for NestedReplaced<T> {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Clone, Hash)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct NestedBase<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -267,7 +267,7 @@ impl <T> Default for NestedBase<T> {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Clone, Hash)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct Incomplete<T> {
pub d: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -276,7 +276,7 @@ impl <T> Default for Incomplete<T> {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Clone, Hash)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct NestedContainer<T> {
pub c: T,
pub nested: NestedReplaced<T>,
@@ -287,7 +287,7 @@ impl <T> Default for NestedContainer<T> {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct Untemplated {
pub _address: u8,
}
@@ -302,7 +302,7 @@ impl Clone for Untemplated {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
pub struct Templated {
pub m_untemplated: Untemplated,
}
@@ -311,7 +311,7 @@ pub struct Templated {
///
/// <div rustbindgen replaces="ReplacedWithoutDestructor"></div>
#[repr(C)]
-#[derive(Debug, Hash)]
+#[derive(Debug, Hash, PartialEq)]
pub struct ReplacedWithoutDestructor<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -320,7 +320,7 @@ impl <T> Default for ReplacedWithoutDestructor<T> {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Hash)]
+#[derive(Debug, Hash, PartialEq)]
pub struct ShouldNotBeCopiable<T> {
pub m_member: ReplacedWithoutDestructor<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -329,7 +329,7 @@ impl <T> Default for ShouldNotBeCopiable<T> {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Hash)]
+#[derive(Debug, Hash, PartialEq)]
pub struct ShouldNotBeCopiableAsWell<U> {
pub m_member: ReplacedWithoutDestructorFwd<U>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>,
@@ -342,7 +342,7 @@ impl <U> Default for ShouldNotBeCopiableAsWell<U> {
///
/// <div rustbindgen replaces="ReplacedWithoutDestructorFwd"></div>
#[repr(C)]
-#[derive(Debug, Hash)]
+#[derive(Debug, Hash, PartialEq)]
pub struct ReplacedWithoutDestructorFwd<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
diff --git a/tests/expectations/tests/template_alias.rs b/tests/expectations/tests/template_alias.rs
index 537fc376..1857e714 100644
--- a/tests/expectations/tests/template_alias.rs
+++ b/tests/expectations/tests/template_alias.rs
@@ -6,7 +6,7 @@
pub type JS_detail_Wrapped<T> = T;
#[repr(C)]
-#[derive(Debug, Copy, Clone, Hash)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct JS_Rooted<T> {
pub ptr: JS_detail_Wrapped<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
diff --git a/tests/expectations/tests/template_alias_namespace.rs b/tests/expectations/tests/template_alias_namespace.rs
index ba94dd7d..46db54dd 100644
--- a/tests/expectations/tests/template_alias_namespace.rs
+++ b/tests/expectations/tests/template_alias_namespace.rs
@@ -17,7 +17,7 @@ pub mod root {
pub type Wrapped<T> = T;
}
#[repr(C)]
- #[derive(Debug, Copy, Clone, Hash)]
+ #[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct Rooted<T> {
pub ptr: root::JS::detail::Wrapped<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
diff --git a/tests/expectations/tests/template_typedef_transitive_param.rs b/tests/expectations/tests/template_typedef_transitive_param.rs
index 6a0026fb..d3114413 100644
--- a/tests/expectations/tests/template_typedef_transitive_param.rs
+++ b/tests/expectations/tests/template_typedef_transitive_param.rs
@@ -5,12 +5,12 @@
#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
pub struct Wrapper {
pub _address: u8,
}
#[repr(C)]
-#[derive(Debug, Copy, Clone, Hash)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct Wrapper_Wrapped<T> {
pub t: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
diff --git a/tests/expectations/tests/templateref_opaque.rs b/tests/expectations/tests/templateref_opaque.rs
index a20dd691..3f119382 100644
--- a/tests/expectations/tests/templateref_opaque.rs
+++ b/tests/expectations/tests/templateref_opaque.rs
@@ -5,13 +5,13 @@
#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
pub struct detail_PointerType {
pub _address: u8,
}
pub type detail_PointerType_Type<T> = *mut T;
#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
pub struct UniquePtr {
pub _address: u8,
}
diff --git a/tests/headers/anonymous-template-types.hpp b/tests/headers/anonymous-template-types.hpp
index 34924fc9..883f60f5 100644
--- a/tests/headers/anonymous-template-types.hpp
+++ b/tests/headers/anonymous-template-types.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash -- -std=c++14
+// bindgen-flags: --with-derive-hash --with-derive-partialeq -- -std=c++14
template <typename T, typename>
struct Foo {
diff --git a/tests/headers/empty_template_param_name.hpp b/tests/headers/empty_template_param_name.hpp
index ef212d55..11b6221c 100644
--- a/tests/headers/empty_template_param_name.hpp
+++ b/tests/headers/empty_template_param_name.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash
+// bindgen-flags: --with-derive-hash --with-derive-partialeq
// bindgen-flags: -- -std=c++11
template<typename...> using __void_t = void;
diff --git a/tests/headers/template-fun-ty.hpp b/tests/headers/template-fun-ty.hpp
index cc33fb74..ea820e2a 100644
--- a/tests/headers/template-fun-ty.hpp
+++ b/tests/headers/template-fun-ty.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash
+// bindgen-flags: --with-derive-hash --with-derive-partialeq
template <typename T>
class Foo
{
diff --git a/tests/headers/template.hpp b/tests/headers/template.hpp
index 24638745..b7566c71 100644
--- a/tests/headers/template.hpp
+++ b/tests/headers/template.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash -- -std=c++11
+// bindgen-flags: --with-derive-hash --with-derive-partialeq -- -std=c++11
//
template<typename T, typename U> class Foo {
T m_member;
diff --git a/tests/headers/template_alias.hpp b/tests/headers/template_alias.hpp
index 684bf286..1877db5c 100644
--- a/tests/headers/template_alias.hpp
+++ b/tests/headers/template_alias.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash -- -std=c++14
+// bindgen-flags: --with-derive-hash --with-derive-partialeq -- -std=c++14
namespace JS {
namespace detail {
diff --git a/tests/headers/template_alias_namespace.hpp b/tests/headers/template_alias_namespace.hpp
index b24e4bd3..fafa6f27 100644
--- a/tests/headers/template_alias_namespace.hpp
+++ b/tests/headers/template_alias_namespace.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash --enable-cxx-namespaces -- -std=c++14
+// bindgen-flags: --with-derive-hash --with-derive-partialeq --enable-cxx-namespaces -- -std=c++14
namespace JS {
namespace detail {
diff --git a/tests/headers/template_typedef_transitive_param.hpp b/tests/headers/template_typedef_transitive_param.hpp
index 2c50cda6..0f657c1e 100644
--- a/tests/headers/template_typedef_transitive_param.hpp
+++ b/tests/headers/template_typedef_transitive_param.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash
+// bindgen-flags: --with-derive-hash --with-derive-partialeq
template<typename T>
struct Wrapper {
struct Wrapped {
diff --git a/tests/headers/templateref_opaque.hpp b/tests/headers/templateref_opaque.hpp
index 1dcf4778..e52f7e82 100644
--- a/tests/headers/templateref_opaque.hpp
+++ b/tests/headers/templateref_opaque.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash
+// bindgen-flags: --with-derive-hash --with-derive-partialeq
namespace detail {
template<typename T>