Skip to content

Commit 5dd038f

Browse files
committed
Update tests
1 parent 6459f36 commit 5dd038f

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

tests/unit/out/refcount/push_emplace_back.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub fn push_local_from_field_1(jpg: Ptr<JPEGData>, cond: bool) {
8888
- __a0.get_offset(),
8989
);
9090
while __a0 != (head.as_pointer() as Ptr<u8>).offset((3) as isize) {
91-
__out.push(__a0.read());
91+
__out.push(u8::try_from(__a0.read()).ok().unwrap());
9292
__a0 += 1;
9393
}
9494
__out
@@ -134,7 +134,7 @@ pub fn emplace_local_from_field_4(jpg: Ptr<JPEGData>, cond: bool) {
134134
- __a0.get_offset(),
135135
);
136136
while __a0 != (head.as_pointer() as Ptr<u8>).offset((3) as isize) {
137-
__out.push(__a0.read());
137+
__out.push(u8::try_from(__a0.read()).ok().unwrap());
138138
__a0 += 1;
139139
}
140140
__out

tests/unit/out/unsafe/push_emplace_back.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ pub unsafe fn push_local_from_field_1(mut jpg: *mut JPEGData, mut cond: bool) {
3939
head.as_mut_ptr(),
4040
(head.as_mut_ptr().offset((3) as isize)).offset_from(head.as_mut_ptr()) as usize,
4141
)
42-
.to_vec(),
42+
.iter()
43+
.map(|x| u8::try_from(x.clone()).ok().unwrap())
44+
.collect(),
4345
);
4446
}
4547
pub unsafe fn shrink_through_ptr_2(mut comps: *mut Vec<Chunk>) {
@@ -61,7 +63,9 @@ pub unsafe fn emplace_local_from_field_4(mut jpg: *mut JPEGData, mut cond: bool)
6163
head.as_mut_ptr(),
6264
(head.as_mut_ptr().offset((3) as isize)).offset_from(head.as_mut_ptr()) as usize,
6365
)
64-
.to_vec(),
66+
.iter()
67+
.map(|x| u8::try_from(x.clone()).ok().unwrap())
68+
.collect(),
6569
);
6670
}
6771
pub unsafe fn nested_emplace_move_5(mut bw: *mut Writer) {

0 commit comments

Comments
 (0)