-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge test_fs_open_no_permissions with test_fcntl_open. NFC #23231
Changes from 4 commits
27b88f4
a9b4aaf
0b983c2
2dadfcd
c30c7ed
809be42
b237c14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,8 +151,18 @@ void test() { | |
errno = 0; | ||
} | ||
|
||
void test_open_create_no_permissions() { | ||
int res = open("a", O_CREAT, 0); | ||
printf("error: %s\n", strerror(errno)); | ||
assert(res >= 0); | ||
struct stat st; | ||
assert(stat("a", &st) == 0); | ||
assert((st.st_mode & 0777) == 0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the line that fails on windows? Perhaps we could make it more flexible? As it stands if we add
That way only that particular variant will be skipped. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's the one: See https://logs.chromium.org/logs/emscripten-releases/buildbucket/cr-buildbucket/8728106183896305361/+/u/Emscripten_testsuite__core0_/stdout (line 19 of the original) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But it also fails on nodefs, not just on noderawfs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a bunch of test that have something like |
||
} | ||
|
||
int main() { | ||
setup(); | ||
test(); | ||
test_open_create_no_permissions(); | ||
return 0; | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It it worth trying to split up this main function while you are here? It looks like at least the last 5 lines could b split into
test_creat
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this would take a fair amount of effort since almost all of the function is one big loop. Probably the loop body should be hoisted into a function.