Details
- Reviewers
 curdeius ldionne - Group Reviewers
 Restricted Project - Commits
 - rGb166441bbe7f: [libcxx] [test] Use GetWindowsInaccessibleDir() instead of dirs with perms…
 
Diff Detail
- Repository
 - rG LLVM Github Monorepo
 
Event Timeline
Amended to remove xfails and to allow the dir to be missing. Has 1 approval from earlier.
| libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp | ||
|---|---|---|
| 84 | The general approach looks great to me, but I do think it'd make more sense to pull scoped_test_env env; up to the top of main regardless of _WIN32. Even if that "scope guard" is redundant on Windows, it feels sketchy to declare a "scope guard" variable inside an ifdef when its lifetime extends outside the ifdef.  | |
| libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp | ||
|---|---|---|
| 84 | Hmm, I can see that it stylistically is weird in one way to have it outlive the ifdef, but I still think I prefer it this way - the ifdef branches set up different variables that then exist for the duration of the surrounding scope... If there's more opinions in this direction I can change it of course.  | |
| libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp | ||
|---|---|---|
| 84 | I agree with Arthur, it is less surprising to have the guard in all branches of #if. Even if it's not necessary on Windows now, it may become necessary one day, this can avoid stupid mistakes then.  | |
| libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp | ||
|---|---|---|
| 84 | Ok, thanks for chiming in. Updating then.  | |
The general approach looks great to me, but I do think it'd make more sense to pull scoped_test_env env; up to the top of main regardless of _WIN32. Even if that "scope guard" is redundant on Windows, it feels sketchy to declare a "scope guard" variable inside an ifdef when its lifetime extends outside the ifdef.
(If you do this, obviously, do it consistently everywhere.)