If the corresponding environment variables are empty, the
uv_us_homedir() and uv_os_tmpdir() return garbage values. The reason
for this situation is the Windows API which doesn't return an error
even if the path is empty.
This PR fixes this problem by checking the return value of the API
call. If it is not an error and the length of the value is less than 3,
uv_us_homedir() and uv_os_tmpdir() will return UV_ENOENT.
Fixes: https://github.com/libuv/libuv/issues/2328
Switch from old-style ASSERT macro to new-style ASSERT_EQ,... macros.
Using new-style macros makes it easier to debug test failures
Fixes: https://github.com/libuv/libuv/issues/2974
Commit ff29322b ("test: canonicalize test runner path") from 2014
changed the test runner to call `realpath(3)` on `argv[0]` in order
to fix the `get_currentexe` test failing with the autotools build when
the executable path contained symbolic links but that is now causing
the `spawn_reads_child_path` test to fail on z/os with the cmake build.
Fix that by only doing path canonicalization in the `get_currentexe`
test, not always.
An auxiliary fix is applied to the `process_title_threadsafe` test
because it assumed that setting the process title to a long string,
then reading it back produces in the original string.
On some platforms however the maximum size of the process title is
limited to the size of the `argv` vector.
Because the test runner used absolute paths until now, the argv vector
was bigger than it is with relative paths, big enough to let this bad
assumption go unnoticed until now.
Minor fixes are applied to tests that assumed 1024 for the maximum
path size because this commit makes visible that some of the CI matrix
systems support much longer paths.
PR-URL: https://github.com/libuv/libuv/pull/2755
Refs: https://github.com/libuv/libuv/pull/2737#issuecomment-602800431
Refs: https://github.com/libuv/libuv/pull/2754#issuecomment-604015785
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Currently, the tests assert that the home directory doesn't end
in a slash. However, if the home directory is / or something like
C:\, then this assertion is incorrect. This commit adds special
handling for these cases.
Fixes: https://github.com/libuv/libuv/issues/812
PR-URL: https://github.com/libuv/libuv/pull/813
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit adds the copyright header to the two tests that
were missing it.
PR-URL: https://github.com/libuv/libuv/pull/782
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>