Fix OSX implementation of BLI_current_working_dir and improve tests. #105220

Merged
Bastien Montagne merged 1 commits from mont29/blender:fix-bli-cwd into main 2023-02-26 15:52:30 +01:00

1 Commits

Author SHA1 Message Date
Bastien Montagne 3d9eff5762 Fix OSX implementation of `BLI_current_working_dir` and improve tests.
buildbot/vexp-code-patch-coordinator Build done. Details
While some implementations of `getcwd` may return an allocated string
instead of the given char buffer in some cases, this is not the expected
behavior of the BLI wrapper. Not to mention the danger of returning a
pointer to a static char buffer...

Improve `ChangeWorkingDirectoryTest` to be more 'full check' regarding
behavior of both `BLI_current_working_dir` and `BLI_change_working_dir`.
Also move call to `BLI_threadapi_init` into proper `SetUp` method (to
have correct symmetry with the call to `BLI_threadapi_exit` in the
`TearDown` one).

Based on investigation by Charles Wardlaw (@CharlesWardlaw).
2023-02-26 15:26:24 +01:00