convert all errno assertions to assert_errno!
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use std::{env, process};
|
||||
use wasi_tests::{create_file, open_scratch_directory};
|
||||
use wasi_tests::{assert_errno, create_file, open_scratch_directory};
|
||||
|
||||
unsafe fn test_truncation_rights(dir_fd: wasi::Fd) {
|
||||
// Create a file in the scratch directory.
|
||||
@@ -64,12 +64,11 @@ unsafe fn test_truncation_rights(dir_fd: wasi::Fd) {
|
||||
|
||||
// Test that we can't truncate the file without the
|
||||
// wasi_unstable::RIGHT_PATH_FILESTAT_SET_SIZE right.
|
||||
assert_eq!(
|
||||
assert_errno!(
|
||||
wasi::path_open(dir_fd, 0, "file", wasi::OFLAGS_TRUNC, 0, 0, 0)
|
||||
.expect_err("truncating a file without path_filestat_set_size right")
|
||||
.raw_error(),
|
||||
wasi::ERRNO_NOTCAPABLE,
|
||||
"errno should be ERRNO_NOTCAPABLE",
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user