Skip to content

Commit 06b2beb

Browse files
committed
Add a test for the types
1 parent 5b10d1b commit 06b2beb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/types.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,19 @@ impl fmt::Debug for c_void {
2323
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2424
f.pad("c_void")
2525
}
26+
}
27+
28+
#[cfg(test)]
29+
mod tests {
30+
use std::os::raw;
31+
use std::any::TypeId;
32+
use types;
33+
34+
#[test]
35+
fn verify_types() {
36+
assert_eq!(TypeId::of::<types::c_int>(), TypeId::of::<raw::c_int>());
37+
assert_eq!(TypeId::of::<types::c_uchar>(), TypeId::of::<raw::c_uchar>());
38+
assert_eq!(TypeId::of::<types::c_uint>(), TypeId::of::<raw::c_uint>());
39+
assert_eq!(TypeId::of::<types::c_char>(), TypeId::of::<raw::c_char>());
40+
}
2641
}

0 commit comments

Comments
 (0)