Skip to content

Commit 4a5ae08

Browse files
Emilgardisemilio
authored andcommitted
disable layout tests for derive-custom and convert-cpp-comment-to-rust test
1 parent d90a41a commit 4a5ae08

File tree

4 files changed

+2
-120
lines changed

4 files changed

+2
-120
lines changed

tests/expectations/tests/convert-cpp-comment-to-rust.rs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,6 @@ pub struct mbedtls_mpi {
1717
///< pointer to limbs
1818
pub p: *mut mbedtls_mpi_uint,
1919
}
20-
#[test]
21-
fn bindgen_test_layout_mbedtls_mpi() {
22-
assert_eq!(
23-
::std::mem::size_of::<mbedtls_mpi>(),
24-
24usize,
25-
concat!("Size of: ", stringify!(mbedtls_mpi))
26-
);
27-
assert_eq!(
28-
::std::mem::align_of::<mbedtls_mpi>(),
29-
8usize,
30-
concat!("Alignment of ", stringify!(mbedtls_mpi))
31-
);
32-
assert_eq!(
33-
unsafe {
34-
&(*(::std::ptr::null::<mbedtls_mpi>())).s as *const _ as usize
35-
},
36-
0usize,
37-
concat!(
38-
"Offset of field: ",
39-
stringify!(mbedtls_mpi),
40-
"::",
41-
stringify!(s)
42-
)
43-
);
44-
assert_eq!(
45-
unsafe {
46-
&(*(::std::ptr::null::<mbedtls_mpi>())).n as *const _ as usize
47-
},
48-
8usize,
49-
concat!(
50-
"Offset of field: ",
51-
stringify!(mbedtls_mpi),
52-
"::",
53-
stringify!(n)
54-
)
55-
);
56-
assert_eq!(
57-
unsafe {
58-
&(*(::std::ptr::null::<mbedtls_mpi>())).p as *const _ as usize
59-
},
60-
16usize,
61-
concat!(
62-
"Offset of field: ",
63-
stringify!(mbedtls_mpi),
64-
"::",
65-
stringify!(p)
66-
)
67-
);
68-
}
6920
impl Default for mbedtls_mpi {
7021
fn default() -> Self {
7122
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();

tests/expectations/tests/derive-custom.rs

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -11,85 +11,16 @@
1111
pub struct my_type {
1212
pub a: ::std::os::raw::c_int,
1313
}
14-
#[test]
15-
fn bindgen_test_layout_my_type() {
16-
assert_eq!(
17-
::std::mem::size_of::<my_type>(),
18-
4usize,
19-
concat!("Size of: ", stringify!(my_type))
20-
);
21-
assert_eq!(
22-
::std::mem::align_of::<my_type>(),
23-
4usize,
24-
concat!("Alignment of ", stringify!(my_type))
25-
);
26-
assert_eq!(
27-
unsafe { &(*(::std::ptr::null::<my_type>())).a as *const _ as usize },
28-
0usize,
29-
concat!(
30-
"Offset of field: ",
31-
stringify!(my_type),
32-
"::",
33-
stringify!(a)
34-
)
35-
);
36-
}
3714
/// <div rustbindgen derive="Debug"></div>
3815
/// <div rustbindgen derive="Clone"></div>
3916
#[repr(C)]
4017
#[derive(Default, Debug, Clone)]
4118
pub struct my_type2 {
4219
pub a: ::std::os::raw::c_uint,
4320
}
44-
#[test]
45-
fn bindgen_test_layout_my_type2() {
46-
assert_eq!(
47-
::std::mem::size_of::<my_type2>(),
48-
4usize,
49-
concat!("Size of: ", stringify!(my_type2))
50-
);
51-
assert_eq!(
52-
::std::mem::align_of::<my_type2>(),
53-
4usize,
54-
concat!("Alignment of ", stringify!(my_type2))
55-
);
56-
assert_eq!(
57-
unsafe { &(*(::std::ptr::null::<my_type2>())).a as *const _ as usize },
58-
0usize,
59-
concat!(
60-
"Offset of field: ",
61-
stringify!(my_type2),
62-
"::",
63-
stringify!(a)
64-
)
65-
);
66-
}
6721
/// <div rustbindgen derive="Debug" derive="Clone"></div>
6822
#[repr(C)]
6923
#[derive(Default, Debug, Clone)]
7024
pub struct my_type3 {
7125
pub a: ::std::os::raw::c_ulong,
7226
}
73-
#[test]
74-
fn bindgen_test_layout_my_type3() {
75-
assert_eq!(
76-
::std::mem::size_of::<my_type3>(),
77-
8usize,
78-
concat!("Size of: ", stringify!(my_type3))
79-
);
80-
assert_eq!(
81-
::std::mem::align_of::<my_type3>(),
82-
8usize,
83-
concat!("Alignment of ", stringify!(my_type3))
84-
);
85-
assert_eq!(
86-
unsafe { &(*(::std::ptr::null::<my_type3>())).a as *const _ as usize },
87-
0usize,
88-
concat!(
89-
"Offset of field: ",
90-
stringify!(my_type3),
91-
"::",
92-
stringify!(a)
93-
)
94-
);
95-
}

tests/headers/convert-cpp-comment-to-rust.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
// bindgen-flags: --no-layout-tests
22
typedef unsigned mbedtls_mpi_uint;
33

44
/**

tests/headers/derive-custom.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bindgen-flags: --no-derive-debug --no-derive-copy --default-enum-style rust
1+
// bindgen-flags: --no-derive-debug --no-derive-copy --default-enum-style rust --no-layout-tests
22

33
/** <div rustbindgen derive="Debug"></div> */
44
struct my_type;

0 commit comments

Comments
 (0)