Skip to content

Commit 583d1d9

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 <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>
1 parent 676b84a commit 583d1d9

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
return 0;
5363
}

test/wasi/wasm/stat.wasm

710 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)