-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move testing of primitive types from std
- Loading branch information
1 parent
d1df54e
commit d4da6c8
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use std::any::TypeId; | ||
|
||
macro_rules! ok { | ||
($($t:ident)*) => {$( | ||
assert!(TypeId::of::<libc::$t>() == TypeId::of::<ffi::$t>(), | ||
"{} is wrong", stringify!($t)); | ||
)*} | ||
} | ||
|
||
#[test] | ||
fn same() { | ||
use std::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); | ||
} |