Skip to content

Commit

Permalink
test: add WASI test for path_link()
Browse files Browse the repository at this point in the history
PR-URL: #32132
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
cjihrig committed Mar 8, 2020
1 parent 5688eb8 commit aa3360f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/wasi/c/link.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <assert.h>
#include <unistd.h>
#include <sys/stat.h>

#define OLD "/sandbox/input.txt"
#define NEW "/tmp/output.txt"

int main() {
struct stat st_old;
struct stat st_new;

assert(0 == stat(OLD, &st_old));
assert(0 == link(OLD, NEW));
assert(0 == stat(NEW, &st_new));
assert(st_old.st_ino == st_new.st_ino);
return 0;
}
1 change: 1 addition & 0 deletions test/wasi/test-wasi.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ if (process.argv[2] === 'wasi-child') {
runWASI({ test: 'getentropy' });
runWASI({ test: 'getrusage' });
runWASI({ test: 'gettimeofday' });
runWASI({ test: 'link' });
runWASI({ test: 'main_args' });
runWASI({ test: 'notdir' });
// runWASI({ test: 'poll' });
Expand Down
Binary file added test/wasi/wasm/link.wasm
Binary file not shown.

0 comments on commit aa3360f

Please sign in to comment.