Skip to content

Commit 57c0e79

Browse files
committed
Update tests
1 parent 2ad45b7 commit 57c0e79

36 files changed

Lines changed: 259 additions & 318 deletions

‎tests/ub/out/refcount/fd_use_after_close.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ fn main_0() -> i32 {
3636
((buf.as_pointer() as Ptr<i8>) as Ptr<i8>)
3737
.to_any()
3838
.reinterpret_cast::<u8>()
39-
.with_slice_mut(::std::mem::size_of::<[i8; 4]>(), |__buf| {
40-
nix::unistd::read(__fd, __buf)
41-
})
39+
.with_slice_mut(4usize, |__buf| nix::unistd::read(__fd, __buf))
4240
}) {
4341
Ok(__n) => __n as isize,
4442
Err(__e) => {

‎tests/unit/out/refcount/array_field_addr.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn main_0() -> i32 {
3737
{
3838
((array_field_ptr!(s, mask) as Ptr<u8>) as Ptr<u8>)
3939
.to_any()
40-
.memset((5) as u8, ::std::mem::size_of::<[u8; 4]>() as usize);
40+
.memset((5) as u8, 4usize as usize);
4141
((array_field_ptr!(s, mask) as Ptr<u8>) as Ptr<u8>).to_any()
4242
};
4343
field!(s, after).write(2);
@@ -46,7 +46,7 @@ fn main_0() -> i32 {
4646
{
4747
((out.as_pointer() as Ptr<u8>) as Ptr<u8>).to_any().memcpy(
4848
&((array_field_ptr!(s, mask)) as Ptr<u8>).to_any(),
49-
::std::mem::size_of::<[u8; 4]>() as usize,
49+
4usize as usize,
5050
);
5151
((out.as_pointer() as Ptr<u8>) as Ptr<u8>).to_any()
5252
};

‎tests/unit/out/refcount/bsearch_ptr_cmp.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn main_0() -> i32 {
2424
let mut __found = AnyPtr::default();
2525
while __lo <= __hi && __found.is_null() {
2626
let __mid = __lo + (__hi - __lo) / 2;
27-
let __elem = __base.offset(__mid as usize * ::std::mem::size_of::<i32>());
27+
let __elem = __base.offset(__mid as usize * 4usize);
2828
let __r = int_cmp_0(
2929
(((a1.as_pointer() as Ptr<i32>).offset(0)) as Ptr<i32>)
3030
.to_any()

‎tests/unit/out/refcount/concepts.rs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ use std::io::{Read, Seek, Write};
77
use std::os::fd::AsFd;
88
use std::rc::{Rc, Weak};
99
const _: () = assert!(true, "Small<int>");
10-
const _: () = assert!(
11-
(::std::mem::size_of::<i32>() == 4_usize),
12-
"sizeof(int) == 4"
13-
);
10+
const _: () = assert!((4usize == 4_usize), "sizeof(int) == 4");
1411
#[derive(Clone, Record, ByteRepr, VaArg, FnPtrArg, Default)]
1512
#[byte_size(1)]
1613
pub struct Sized {}

‎tests/unit/out/refcount/destructor.rs‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ impl Templated_char_Impl for Ptr<Templated_char_> {
273273
fn destructor(&self) {
274274
global_0.with(|rc| {
275275
*rc.borrow_mut() = {
276-
((global_0.with(|rc| *rc.borrow()) as usize)
277-
.wrapping_add((::std::mem::size_of::<i8>() as usize))) as i32
276+
((global_0.with(|rc| *rc.borrow()) as usize).wrapping_add((1usize as usize))) as i32
278277
}
279278
});
280279
}
@@ -286,8 +285,7 @@ impl Templated_int_Impl for Ptr<Templated_int_> {
286285
fn destructor(&self) {
287286
global_0.with(|rc| {
288287
*rc.borrow_mut() = {
289-
((global_0.with(|rc| *rc.borrow()) as usize)
290-
.wrapping_add((::std::mem::size_of::<i32>() as usize))) as i32
288+
((global_0.with(|rc| *rc.borrow()) as usize).wrapping_add((4usize as usize))) as i32
291289
}
292290
});
293291
}

‎tests/unit/out/refcount/enum_underlying_type.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ fn main_0() -> i32 {
3838
assert!(((b as i32) == (false as i32)));
3939
let mut s: Small = Small_SMALL_MAX;
4040
assert!(((s as i32) == 255));
41-
assert!((::std::mem::size_of::<Small>() == 1_usize));
41+
assert!((1usize == 1_usize));
4242
s = Small_SMALL_ZERO;
4343
assert!((((s as i32) + 1) == 1));
4444
let mut sg: Signed = Signed_SIGNED_MIN;
4545
assert!(((sg as i32) == -128_i32));
4646
assert!(((sg as i32) < (Signed_SIGNED_ONE as i32)));
4747
let mut w: Wide = Wide_WIDE_BIG;
4848
assert!(((w as i64) == (1_i64 << 40)));
49-
assert!((::std::mem::size_of::<Wide>() == 8_usize));
49+
assert!((8usize == 8_usize));
5050
assert!(((Wide_WIDE_NEG as i64) < 0_i64));
5151
let mut z: Sized = Sized_SIZED_B;
5252
assert!(((z as i32) == 65535));
53-
assert!((::std::mem::size_of::<Sized>() == 2_usize));
53+
assert!((2usize == 2_usize));
5454
assert!((((Sized_SIZED_A as i32) + 1) == 2));
5555
let mut sc: Scoped = Scoped_NEG;
5656
assert!(((sc as i32) == -2_i32));

‎tests/unit/out/refcount/fd_io.rs‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,15 @@ fn main_0() -> i32 {
7070
{
7171
((buf.as_pointer() as Ptr<i8>) as Ptr<i8>)
7272
.to_any()
73-
.memset((0) as u8, ::std::mem::size_of::<[i8; 16]>() as usize);
73+
.memset((0) as u8, 16usize as usize);
7474
((buf.as_pointer() as Ptr<i8>) as Ptr<i8>).to_any()
7575
};
7676
assert!(
7777
(((match FdRegistry::with_fd(fd, |__fd| {
7878
((buf.as_pointer() as Ptr<i8>) as Ptr<i8>)
7979
.to_any()
8080
.reinterpret_cast::<u8>()
81-
.with_slice_mut(::std::mem::size_of::<[i8; 16]>(), |__buf| {
82-
nix::unistd::read(__fd, __buf)
83-
})
81+
.with_slice_mut(16usize, |__buf| nix::unistd::read(__fd, __buf))
8482
}) {
8583
Ok(__n) => __n as isize,
8684
Err(__e) => {
@@ -112,9 +110,7 @@ fn main_0() -> i32 {
112110
((buf.as_pointer() as Ptr<i8>) as Ptr<i8>)
113111
.to_any()
114112
.reinterpret_cast::<u8>()
115-
.with_slice_mut(::std::mem::size_of::<[i8; 16]>(), |__buf| {
116-
nix::unistd::read(__fd, __buf)
117-
})
113+
.with_slice_mut(16usize, |__buf| nix::unistd::read(__fd, __buf))
118114
}) {
119115
Ok(__n) => __n as isize,
120116
Err(__e) => {

‎tests/unit/out/refcount/field_pointers.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ fn main_0() -> i32 {
171171
a
172172
)) as Ptr<i32>)
173173
.to_any(),
174-
::std::mem::size_of::<i32>() as usize,
174+
4usize as usize,
175175
);
176176
((field_ptr!(
177177
(array_field_ptr!(o.as_pointer(), items) as Ptr<Inner>).offset((2) as isize),
@@ -186,7 +186,7 @@ fn main_0() -> i32 {
186186
a
187187
)) as Ptr<i32>)
188188
.to_any(),
189-
::std::mem::size_of::<i32>() as usize,
189+
4usize as usize,
190190
);
191191
((y.as_pointer()) as Ptr<i32>).to_any()
192192
};

0 commit comments

Comments
 (0)