Rollup merge of #66998 - Wind-River:master_up, r=alexcrichton

Modified the testcases for VxWorks
This commit is contained in:
Yuki Okushi 2019-12-07 00:09:57 +09:00 committed by GitHub
commit cdbdb686f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2339,8 +2339,10 @@ mod tests {
let filename = &tmpdir.join("file_that_does_not_exist.txt");
let result = File::open(filename);
#[cfg(unix)]
#[cfg(all(unix, not(target_os = "vxworks")))]
error!(result, "No such file or directory");
#[cfg(target_os = "vxworks")]
error!(result, "no such file or directory");
#[cfg(windows)]
error!(result, 2); // ERROR_FILE_NOT_FOUND
}
@ -2352,8 +2354,10 @@ mod tests {
let result = fs::remove_file(filename);
#[cfg(unix)]
#[cfg(all(unix, not(target_os = "vxworks")))]
error!(result, "No such file or directory");
#[cfg(target_os = "vxworks")]
error!(result, "no such file or directory");
#[cfg(windows)]
error!(result, 2); // ERROR_FILE_NOT_FOUND
}
@ -2553,7 +2557,10 @@ mod tests {
check!(fs::set_permissions(filename, fs::Permissions::from_mode(0o1777)));
let metadata1 = check!(fs::metadata(filename));
#[cfg(all(unix, not(target_os = "vxworks")))]
assert_eq!(mask & metadata1.permissions().mode(), 0o1777);
#[cfg(target_os = "vxworks")]
assert_eq!(mask & metadata1.permissions().mode(), 0o0777);
}
#[test]