File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -239,17 +239,17 @@ fn test_symlink() {
239239 // and check that the last byte is not overwritten.
240240 let mut large_buf = vec ! [ 0xFF ; expected_path. len( ) + 1 ] ;
241241 let res = unsafe { libc:: readlink ( symlink_c_ptr, large_buf. as_mut_ptr ( ) . cast ( ) , large_buf. len ( ) ) } ;
242- assert_eq ! ( res, large_buf. len( ) as isize - 1 ) ;
243242 // Check that the resovled path was properly written into the buf.
244243 assert_eq ! ( & large_buf[ ..( large_buf. len( ) - 1 ) ] , expected_path) ;
245244 assert_eq ! ( large_buf. last( ) , Some ( & 0xFF ) ) ;
245+ assert_eq ! ( res, large_buf. len( ) as isize - 1 ) ;
246246
247247 // Test that the resolved path is truncated if the provided buffer
248248 // is too small.
249249 let mut small_buf = [ 0u8 ; 2 ] ;
250250 let res = unsafe { libc:: readlink ( symlink_c_ptr, small_buf. as_mut_ptr ( ) . cast ( ) , small_buf. len ( ) ) } ;
251- assert_eq ! ( res, small_buf. len( ) as isize ) ;
252251 assert_eq ! ( small_buf, & expected_path[ ..small_buf. len( ) ] ) ;
252+ assert_eq ! ( res, small_buf. len( ) as isize ) ;
253253
254254 // Test that we report a proper error for a missing path.
255255 let bad_path = CString :: new ( "MIRI_MISSING_FILE_NAME" ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments