Skip to content

Commit c8cc152

Browse files
authored
Merge pull request #3616 from ChrisDenton/primitive
Move testing of primitive types from std
2 parents d1df54e + d4da6c8 commit c8cc152

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

libc-test/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,8 @@ harness = true
8585
name = "semver"
8686
path = "test/semver.rs"
8787
harness = false
88+
89+
[[test]]
90+
name = "primitive_types"
91+
path = "test/primitive_types.rs"
92+
harness = true

libc-test/test/primitive_types.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use std::any::TypeId;
2+
3+
macro_rules! ok {
4+
($($t:ident)*) => {$(
5+
assert!(TypeId::of::<libc::$t>() == TypeId::of::<ffi::$t>(),
6+
"{} is wrong", stringify!($t));
7+
)*}
8+
}
9+
10+
#[test]
11+
fn same() {
12+
use std::ffi;
13+
ok!(c_char c_schar c_uchar c_short c_ushort c_int c_uint c_long c_ulong
14+
c_longlong c_ulonglong c_float c_double);
15+
}

0 commit comments

Comments
 (0)