MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / test_chmod_errors

Function test_chmod_errors

test/unistd/access.c:79–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void test_chmod_errors() {
80 EM_ASM(
81 var ex;
82 try {
83 FS.chmod("nonexistent", 0o777);
84 } catch (err) {
85 ex = err;
86 }
87 assert(ex.name === "ErrnoError" && ex.errno === 44 /* ENOENT */);
88
89 try {
90 FS.fchmod(99, 0o777);
91 } catch (err) {
92 ex = err;
93 }
94 assert(ex.name === "ErrnoError" && ex.errno === 8 /* EBADF */);
95
96 try {
97 FS.lchmod("nonexistent", 0o777);
98 } catch (err) {
99 ex = err;
100 }
101 assert(ex.name === "ErrnoError" && ex.errno === 44 /* ENOENT */);
102 );
103}
104
105int main() {
106 setup();

Callers 1

mainFunction · 0.85

Calls 1

assertFunction · 0.50

Tested by

no test coverage detected