From 4a5ae0884da76d6d8538a6cc607e5dba144842db Mon Sep 17 00:00:00 2001 From: Emil Gardström Date: Fri, 25 Feb 2022 21:39:34 +0100 Subject: disable layout tests for `derive-custom` and `convert-cpp-comment-to-rust` test --- .../tests/convert-cpp-comment-to-rust.rs | 49 --------------- tests/expectations/tests/derive-custom.rs | 69 ---------------------- tests/headers/convert-cpp-comment-to-rust.hpp | 2 +- tests/headers/derive-custom.h | 2 +- 4 files changed, 2 insertions(+), 120 deletions(-) diff --git a/tests/expectations/tests/convert-cpp-comment-to-rust.rs b/tests/expectations/tests/convert-cpp-comment-to-rust.rs index 86279caf..09a22c4f 100644 --- a/tests/expectations/tests/convert-cpp-comment-to-rust.rs +++ b/tests/expectations/tests/convert-cpp-comment-to-rust.rs @@ -17,55 +17,6 @@ pub struct mbedtls_mpi { ///< pointer to limbs pub p: *mut mbedtls_mpi_uint, } -#[test] -fn bindgen_test_layout_mbedtls_mpi() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(mbedtls_mpi)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mbedtls_mpi)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).s as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mbedtls_mpi), - "::", - stringify!(s) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).n as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mbedtls_mpi), - "::", - stringify!(n) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).p as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mbedtls_mpi), - "::", - stringify!(p) - ) - ); -} impl Default for mbedtls_mpi { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); diff --git a/tests/expectations/tests/derive-custom.rs b/tests/expectations/tests/derive-custom.rs index 1cae9af0..542b6bb2 100644 --- a/tests/expectations/tests/derive-custom.rs +++ b/tests/expectations/tests/derive-custom.rs @@ -11,29 +11,6 @@ pub struct my_type { pub a: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_my_type() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(my_type)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(my_type)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(my_type), - "::", - stringify!(a) - ) - ); -} ///
///
#[repr(C)] @@ -41,55 +18,9 @@ fn bindgen_test_layout_my_type() { pub struct my_type2 { pub a: ::std::os::raw::c_uint, } -#[test] -fn bindgen_test_layout_my_type2() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(my_type2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(my_type2)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(my_type2), - "::", - stringify!(a) - ) - ); -} ///
#[repr(C)] #[derive(Default, Debug, Clone)] pub struct my_type3 { pub a: ::std::os::raw::c_ulong, } -#[test] -fn bindgen_test_layout_my_type3() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(my_type3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(my_type3)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(my_type3), - "::", - stringify!(a) - ) - ); -} diff --git a/tests/headers/convert-cpp-comment-to-rust.hpp b/tests/headers/convert-cpp-comment-to-rust.hpp index 649c2365..f5bbbf58 100644 --- a/tests/headers/convert-cpp-comment-to-rust.hpp +++ b/tests/headers/convert-cpp-comment-to-rust.hpp @@ -1,4 +1,4 @@ - +// bindgen-flags: --no-layout-tests typedef unsigned mbedtls_mpi_uint; /** diff --git a/tests/headers/derive-custom.h b/tests/headers/derive-custom.h index 83f2ce08..8c57278c 100644 --- a/tests/headers/derive-custom.h +++ b/tests/headers/derive-custom.h @@ -1,4 +1,4 @@ -// bindgen-flags: --no-derive-debug --no-derive-copy --default-enum-style rust +// bindgen-flags: --no-derive-debug --no-derive-copy --default-enum-style rust --no-layout-tests /**
*/ struct my_type; -- cgit v1.2.3