Add a test for the types

This commit is contained in:
Elichai Turkel 2019-09-14 21:09:23 +03:00
parent 5b10d1b226
commit 06b2bebce8
No known key found for this signature in database
GPG Key ID: 9383CDE9E8E66A7F
1 changed files with 15 additions and 0 deletions

View File

@ -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>());
}
} }