File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ pub fn test_errno_0() {
1818pub 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 ) ) ;
Original file line number Diff line number Diff 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 ) ,
You can’t perform that action at this time.
0 commit comments