Skip to content

Commit 0fb3006

Browse files
committed
Update tests
1 parent cf75ab6 commit 0fb3006

8 files changed

Lines changed: 12 additions & 12 deletions

tests/unit/out/refcount/string_literals.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ fn main_0() -> i32 {
2828
Rc::new(RefCell::new(Box::<[u8]>::from(b"papanasi\0".as_slice())));
2929
let immutable_empty: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal("")));
3030
let mutable_empty_arr: Value<Box<[u8]>> =
31-
Rc::new(RefCell::new(Box::<[u8]>::from(b"\0".as_slice())));
31+
Rc::new(RefCell::new(vec![0u8; 1].into_boxed_slice()));
3232
let immutable_empty_arr: Value<Box<[u8]>> =
33-
Rc::new(RefCell::new(Box::<[u8]>::from(b"\0".as_slice())));
33+
Rc::new(RefCell::new(vec![0u8; 1].into_boxed_slice()));
3434
({
3535
let _str: Ptr<u8> = (mutable_string_arr.as_pointer() as Ptr<u8>);
3636
foo_mut_0(_str)

tests/unit/out/refcount/string_literals_c.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ fn main_0() -> i32 {
3535
let mutable_empty: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal("")));
3636
let immutable_empty: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal("")));
3737
let mutable_empty_arr: Value<Box<[u8]>> =
38-
Rc::new(RefCell::new(Box::<[u8]>::from(b"\0".as_slice())));
38+
Rc::new(RefCell::new(vec![0u8; 1].into_boxed_slice()));
3939
let immutable_empty_arr: Value<Box<[u8]>> =
40-
Rc::new(RefCell::new(Box::<[u8]>::from(b"\0".as_slice())));
40+
Rc::new(RefCell::new(vec![0u8; 1].into_boxed_slice()));
4141
({
4242
let _str: Ptr<u8> = Ptr::from_string_literal("world");
4343
foo_mut_0(_str)

tests/unit/out/refcount/string_literals_sized.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn main() {
1010
std::process::exit(main_0());
1111
}
1212
fn main_0() -> i32 {
13-
let empty_buf : Value<Box<[ u8 ]> > = Rc::new(RefCell::new(Box::<[u8]>::from(b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0".as_slice()) )) ;
13+
let empty_buf: Value<Box<[u8]>> = Rc::new(RefCell::new(vec![0u8; 256].into_boxed_slice()));
1414
assert!((((*empty_buf.borrow())[(0) as usize] as i32) == (('\0' as u8) as i32)));
1515
assert!((((*empty_buf.borrow())[(255) as usize] as i32) == (('\0' as u8) as i32)));
1616
let prefix_buf: Value<Box<[u8]>> = Rc::new(RefCell::new(Box::<[u8]>::from(

tests/unit/out/refcount/string_literals_sized_c.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn main() {
1010
std::process::exit(main_0());
1111
}
1212
fn main_0() -> i32 {
13-
let empty_buf : Value<Box<[ u8 ]> > = Rc::new(RefCell::new(Box::<[u8]>::from(b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0".as_slice()) )) ;
13+
let empty_buf: Value<Box<[u8]>> = Rc::new(RefCell::new(vec![0u8; 256].into_boxed_slice()));
1414
assert!((((*empty_buf.borrow())[(0) as usize] as i32) == ('\0' as i32)));
1515
assert!((((*empty_buf.borrow())[(255) as usize] as i32) == ('\0' as i32)));
1616
let prefix_buf: Value<Box<[u8]>> = Rc::new(RefCell::new(Box::<[u8]>::from(

tests/unit/out/unsafe/string_literals.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ unsafe fn main_0() -> i32 {
1919
let mut mutable_string_arr: [u8; 9] = *b"papanasi\0";
2020
let immutable_string_arr: [u8; 9] = *b"papanasi\0";
2121
let mut immutable_empty: *const u8 = b"\0".as_ptr();
22-
let mut mutable_empty_arr: [u8; 1] = *b"\0";
23-
let immutable_empty_arr: [u8; 1] = *b"\0";
22+
let mut mutable_empty_arr: [u8; 1] = [0u8; 1];
23+
let immutable_empty_arr: [u8; 1] = [0u8; 1];
2424
(unsafe {
2525
let _str: *mut u8 = mutable_string_arr.as_mut_ptr();
2626
foo_mut_0(_str)

tests/unit/out/unsafe/string_literals_c.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ unsafe fn main_0() -> i32 {
3030
let immutable_string_arr: [u8; 9] = *b"papanasi\0";
3131
let mut mutable_empty: *mut u8 = b"\0".as_ptr().cast_mut();
3232
let mut immutable_empty: *const u8 = b"\0".as_ptr().cast_mut().cast_const();
33-
let mut mutable_empty_arr: [u8; 1] = *b"\0";
34-
let immutable_empty_arr: [u8; 1] = *b"\0";
33+
let mut mutable_empty_arr: [u8; 1] = [0u8; 1];
34+
let immutable_empty_arr: [u8; 1] = [0u8; 1];
3535
(unsafe {
3636
let _str: *mut u8 = b"world\0".as_ptr().cast_mut();
3737
foo_mut_0(_str)

tests/unit/out/unsafe/string_literals_sized.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub fn main() {
1212
}
1313
}
1414
unsafe fn main_0() -> i32 {
15-
let mut empty_buf : [ u8 ; 256] = * b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" ;
15+
let mut empty_buf: [u8; 256] = [0u8; 256];
1616
assert!(((empty_buf[(0) as usize] as i32) == (('\0' as u8) as i32)));
1717
assert!(((empty_buf[(255) as usize] as i32) == (('\0' as u8) as i32)));
1818
let mut prefix_buf: [u8; 32] =

tests/unit/out/unsafe/string_literals_sized_c.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub fn main() {
1212
}
1313
}
1414
unsafe fn main_0() -> i32 {
15-
let mut empty_buf : [ u8 ; 256] = * b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" ;
15+
let mut empty_buf: [u8; 256] = [0u8; 256];
1616
assert!(((empty_buf[(0) as usize] as i32) == ('\0' as i32)));
1717
assert!(((empty_buf[(255) as usize] as i32) == ('\0' as i32)));
1818
let mut prefix_buf: [u8; 32] =

0 commit comments

Comments
 (0)