Skip to content

Commit 1428de8

Browse files
cjihrigMylesBorins
authored andcommitted
test: add WASI test for path_link()
PR-URL: #32132 Reviewed-By: David Carlier <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 2e5f81f commit 1428de8

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

‎test/wasi/c/link.c‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include<assert.h>
2+
#include<unistd.h>
3+
#include<sys/stat.h>
4+
5+
#defineOLD "/sandbox/input.txt"
6+
#defineNEW "/tmp/output.txt"
7+
8+
intmain(){
9+
structstatst_old;
10+
structstatst_new;
11+
12+
assert(0==stat(OLD, &st_old));
13+
assert(0==link(OLD, NEW));
14+
assert(0==stat(NEW, &st_new));
15+
assert(st_old.st_ino==st_new.st_ino);
16+
return0;
17+
}

‎test/wasi/test-wasi.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ if (process.argv[2] === 'wasi-child'){
6464
runWASI({test: 'getentropy'});
6565
runWASI({test: 'getrusage'});
6666
runWASI({test: 'gettimeofday'});
67+
runWASI({test: 'link'});
6768
runWASI({test: 'main_args'});
6869
runWASI({test: 'notdir'});
6970
// runWASI({test: 'poll'});

‎test/wasi/wasm/link.wasm‎

30.7 KB
Binary file not shown.

0 commit comments

Comments
(0)