Skip to content

Commit 9115b84

Browse files
committed
Update sys_stat test
1 parent 7de0cfe commit 9115b84

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,19 @@ pub fn test_fstat_1() {
8787
0;
8888
let fd: Value<i32> = Rc::new(RefCell::new((*fp.borrow()).with(|__f| __f.fd)));
8989
let st: Value<libcc2rs::Stat> = Rc::new(RefCell::new(Default::default()));
90-
assert!((((libc::fstat((*fd.borrow()), (st.as_pointer())) == 0) as i32) != 0));
90+
assert!(
91+
(((match FdRegistry::with_fd((*fd.borrow()), |__fd| nix::sys::stat::fstat(__fd)) {
92+
Ok(__s) => {
93+
(st.as_pointer()).with_mut(|__st| *__st = Stat::from_libc(&__s));
94+
0
95+
}
96+
Err(__e) => {
97+
libcc2rs::cpp2rust_errno().write(__e as i32);
98+
-1
99+
}
100+
} == 0) as i32)
101+
!= 0)
102+
);
91103
assert!(((((*(*st.borrow()).st_size.borrow()) == 11_i64) as i32) != 0));
92104
assert!(((((*(*st.borrow()).st_mtime.borrow()) > 0_i64) as i32) != 0));
93105
assert!(

‎tests/unit/sys_stat.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// no-compile: refcount
21
#include <assert.h>
32
#include <errno.h>
43
#include <stdio.h>

0 commit comments

Comments
 (0)