Add a test for the types
This commit is contained in:
parent
5b10d1b226
commit
06b2bebce8
15
src/types.rs
15
src/types.rs
|
@ -23,4 +23,19 @@ impl fmt::Debug for c_void {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.pad("c_void")
|
f.pad("c_void")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use std::os::raw;
|
||||||
|
use std::any::TypeId;
|
||||||
|
use types;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn verify_types() {
|
||||||
|
assert_eq!(TypeId::of::<types::c_int>(), TypeId::of::<raw::c_int>());
|
||||||
|
assert_eq!(TypeId::of::<types::c_uchar>(), TypeId::of::<raw::c_uchar>());
|
||||||
|
assert_eq!(TypeId::of::<types::c_uint>(), TypeId::of::<raw::c_uint>());
|
||||||
|
assert_eq!(TypeId::of::<types::c_char>(), TypeId::of::<raw::c_char>());
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue