Skip to content

Commit

Permalink
Move testing of primitive types from std
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDenton committed Mar 9, 2024
1 parent a0f5b4b commit ba1401f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions libc-test/test/primitive_types.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use core::any::TypeId;

macro_rules! ok {
($($t:ident)*) => {$(
assert!(TypeId::of::<libc::$t>() == TypeId::of::<raw::$t>(),
"{} is wrong", stringify!($t));
)*}
}

#[test]
fn same() {
use core::ffi;
ok!(c_char c_schar c_uchar c_short c_ushort c_int c_uint c_long c_ulong
c_longlong c_ulonglong c_float c_double);
}

0 comments on commit ba1401f

Please sign in to comment.