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() {
239
239
// and check that the last byte is not overwritten.
240
240
let mut large_buf = vec ! [ 0xFF ; expected_path. len( ) + 1 ] ;
241
241
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 ) ;
243
242
// Check that the resovled path was properly written into the buf.
244
243
assert_eq ! ( & large_buf[ ..( large_buf. len( ) - 1 ) ] , expected_path) ;
245
244
assert_eq ! ( large_buf. last( ) , Some ( & 0xFF ) ) ;
245
+ assert_eq ! ( res, large_buf. len( ) as isize - 1 ) ;
246
246
247
247
// Test that the resolved path is truncated if the provided buffer
248
248
// is too small.
249
249
let mut small_buf = [ 0u8 ; 2 ] ;
250
250
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 ) ;
252
251
assert_eq ! ( small_buf, & expected_path[ ..small_buf. len( ) ] ) ;
252
+ assert_eq ! ( res, small_buf. len( ) as isize ) ;
253
253
254
254
// Test that we report a proper error for a missing path.
255
255
let bad_path = CString :: new ( "MIRI_MISSING_FILE_NAME" ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments