Skip to content

Commit 6a23148

Browse files
committed
Update tests
1 parent 21c8f34 commit 6a23148

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

tests/unit/out/refcount/printfs.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ fn main_0() -> i32 {
2626
println!("{}", Ptr::from_string_literal("fprintf stdout"));
2727
println!("{} {} {}", 1, 2_u32, 3_i64);
2828
print!("hello world");
29-
let in_: Value<Ptr<::std::fs::File>> = Rc::new(RefCell::new((libcc2rs::cin()).clone()));
30-
assert!(((*in_.borrow()) != Default::default()));
29+
let in_: Value<Ptr<::std::fs::File>> =
30+
Rc::new(RefCell::new((*stdin.with(Value::clone).borrow()).clone()));
31+
assert!(!((*in_.borrow()).is_null()));
3132
println!("{}", Ptr::from_string_literal("printf"));
3233
print!("hello world");
3334
let s: Value<Vec<u8>> = Rc::new(RefCell::new(

tests/unit/out/unsafe/printfs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ unsafe fn main_0() -> i32 {
3434
);
3535
printf(b"%d %u %ld\n\0".as_ptr() as *const i8, 1, 2_u32, 3_i64);
3636
printf(b"hello world\0".as_ptr() as *const i8);
37-
let mut in_: *mut ::std::fs::File = libcc2rs::cin_unsafe();
38-
assert!(((in_) != (std::ptr::null_mut())));
37+
let mut in_: *mut ::std::fs::File = stdin;
38+
assert!(!((in_).is_null()));
3939
printf(b"%s\n\0".as_ptr() as *const i8, b"printf\0".as_ptr());
4040
printf(b"hello world\0".as_ptr() as *const i8);
4141
let mut s: Vec<u8> = {

0 commit comments

Comments
 (0)