Skip to content

Commit

Permalink
wasi: add __wasi_fd_filestat_set_times() test
Browse files Browse the repository at this point in the history
PR-URL: #34623
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
cjihrig authored and addaleax committed Sep 22, 2020

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent f710dbf commit 4913051
Showing 2 changed files with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/wasi/c/stat.c
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
#define SIZE 500

int main(void) {
struct timespec times[2];
struct stat st;
int fd;
int ret;
@@ -33,6 +34,15 @@ int main(void) {
assert(ret == 0);
assert(st.st_size == SIZE);

times[0].tv_sec = 4;
times[0].tv_nsec = 0;
times[1].tv_sec = 9;
times[1].tv_nsec = 0;
assert(0 == futimens(fd, times));
assert(0 == fstat(fd, &st));
assert(4 == st.st_atime);
assert(9 == st.st_mtime);

ret = close(fd);
assert(ret == 0);

Binary file modified test/wasi/wasm/stat.wasm
Binary file not shown.

0 comments on commit 4913051

Please sign in to comment.