Skip to content

Commit 044dc9c

Browse files
committed
Update tests
1 parent 2c81e6f commit 044dc9c

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

tests/unit/out/refcount/errno.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn test_errno_0() {
1818
pub fn test_errno_preserved_across_strdup_1() {
1919
libcc2rs::cpp2rust_errno().write(99);
2020
let d: Value<Ptr<u8>> = Rc::new(RefCell::new(libcc2rs::strdup_refcount(
21-
Ptr::from_string_literal(b"hello"),
21+
Ptr::from_string_literal(b"hello").clone(),
2222
)));
2323
assert!((((!((*d.borrow()).is_null())) as i32) != 0));
2424
assert!(((((libcc2rs::cpp2rust_errno().read()) == 99) as i32) != 0));

tests/unit/out/refcount/offsetof.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,14 @@ fn main_0() -> i32 {
102102
assert!(((*(*v.borrow()).b.borrow()) == 305419896_u32));
103103
let text: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(b"example-body")));
104104
let len: Value<usize> = Rc::new(RefCell::new(
105-
((*text.borrow()).to_string_iterator().count()).wrapping_add(1_usize),
105+
({
106+
let mut __i: usize = 0;
107+
while (*text.borrow()).offset(__i).read() != 0 {
108+
__i += 1;
109+
}
110+
__i
111+
})
112+
.wrapping_add(1_usize),
106113
));
107114
let total: Value<usize> = Rc::new(RefCell::new(
108115
((2_usize as u64).wrapping_add(((*len.borrow()) as u64)) as usize),

0 commit comments

Comments
 (0)