summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZhiting Zhu <zzhu@mozilla.com>2017-08-11 11:37:26 -0700
committerZhiting Zhu <zzhu@mozilla.com>2017-08-14 10:19:14 -0700
commitdc2baed16c14e2ef2febff11e88b1c5110ebc0eb (patch)
treeba46f2d5cb7ae57aaa62ce1018c1013257ba44a5 /tests
parent238499b52825e1397c8ab47cfe0dba39cf0745bd (diff)
Small tests for derive PartialEq
Diffstat (limited to 'tests')
-rw-r--r--tests/expectations/tests/derive-hash-struct-with-pointer.rs10
-rw-r--r--tests/headers/derive-hash-struct-with-pointer.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/expectations/tests/derive-hash-struct-with-pointer.rs b/tests/expectations/tests/derive-hash-struct-with-pointer.rs
index 007fd2f9..a11d738f 100644
--- a/tests/expectations/tests/derive-hash-struct-with-pointer.rs
+++ b/tests/expectations/tests/derive-hash-struct-with-pointer.rs
@@ -4,9 +4,9 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-/// Pointers can derive hash
+/// Pointers can derive hash/PartialEq
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct ConstPtrMutObj {
pub bar: *const ::std::os::raw::c_int,
}
@@ -29,7 +29,7 @@ impl Default for ConstPtrMutObj {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct MutPtrMutObj {
pub bar: *mut ::std::os::raw::c_int,
}
@@ -52,7 +52,7 @@ impl Default for MutPtrMutObj {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct MutPtrConstObj {
pub bar: *const ::std::os::raw::c_int,
}
@@ -75,7 +75,7 @@ impl Default for MutPtrConstObj {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct ConstPtrConstObj {
pub bar: *const ::std::os::raw::c_int,
}
diff --git a/tests/headers/derive-hash-struct-with-pointer.h b/tests/headers/derive-hash-struct-with-pointer.h
index 262b6fb4..ed5199d4 100644
--- a/tests/headers/derive-hash-struct-with-pointer.h
+++ b/tests/headers/derive-hash-struct-with-pointer.h
@@ -1,6 +1,6 @@
-// bindgen-flags: --with-derive-hash
+// bindgen-flags: --with-derive-hash --with-derive-partialeq
//
-/// Pointers can derive hash
+/// Pointers can derive hash/PartialEq
struct ConstPtrMutObj {
int* const bar;
};