Skip to content

Commit 8438d14

Browse files
cjihrigcodebytere
authored andcommitted
test: improve wasi stat test
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]>
1 parent 5e8f8b8 commit 8438d14

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

‎test/wasi/c/stat.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,15 @@ int main(void){
4949
ret=stat(PATH, &st);
5050
assert(ret==-1);
5151

52+
ret=stat(OUTPUT_DIR, &st);
53+
assert(ret==0);
54+
assert(S_ISDIR(st.st_mode));
55+
56+
ret=rmdir(OUTPUT_DIR);
57+
assert(ret==0);
58+
59+
ret=stat(OUTPUT_DIR, &st);
60+
assert(ret==-1);
61+
5262
return0;
5363
}

‎test/wasi/wasm/stat.wasm‎

710 Bytes
Binary file not shown.

0 commit comments

Comments
(0)