Skip to content

Commit bbba87c

Browse files
committed
Swap order of assertions for easier debugging
1 parent 462f582 commit bbba87c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/run-pass/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)