From d4da6c866a9b25cc37f73d2a27cb9f2d61397298 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Sat, 9 Mar 2024 02:27:20 +0000 Subject: [PATCH] Move testing of primitive types from std --- libc-test/Cargo.toml | 5 +++++ libc-test/test/primitive_types.rs | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 libc-test/test/primitive_types.rs diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index 20543d69bcb0f..8d85ad794ed53 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -85,3 +85,8 @@ harness = true name = "semver" path = "test/semver.rs" harness = false + +[[test]] +name = "primitive_types" +path = "test/primitive_types.rs" +harness = true diff --git a/libc-test/test/primitive_types.rs b/libc-test/test/primitive_types.rs new file mode 100644 index 0000000000000..c125a92a58110 --- /dev/null +++ b/libc-test/test/primitive_types.rs @@ -0,0 +1,15 @@ +use std::any::TypeId; + +macro_rules! ok { + ($($t:ident)*) => {$( + assert!(TypeId::of::() == TypeId::of::(), + "{} 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); +}