Skip to content

Commit

Permalink
test: improve wasi stat test
Browse files Browse the repository at this point in the history
This commit improved the stat test a bit by verifying that
S_ISDIR() works properly. It also adds missing coverage for
__wasi_path_remove_directory().

PR-URL: #31413
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
cjihrig authored and codebytere committed Feb 17, 2020
1 parent 676b84a commit 583d1d9
Show file tree
Hide file tree
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
Expand Up @@ -49,5 +49,15 @@ int main(void) {
ret = stat(PATH, &st);
assert(ret == -1);

ret = stat(OUTPUT_DIR, &st);
assert(ret == 0);
assert(S_ISDIR(st.st_mode));

ret = rmdir(OUTPUT_DIR);
assert(ret == 0);

ret = stat(OUTPUT_DIR, &st);
assert(ret == -1);

return 0;
}
Binary file modified test/wasi/wasm/stat.wasm
Binary file not shown.

0 comments on commit 583d1d9

Please sign in to comment.