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 <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
cjihrig authored and codebytere committed Mar 17, 2020
1 parent 5e8f8b8 commit 8438d14
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 8438d14

Please sign in to comment.