mirror of https://github.com/wolfSSL/wolfssh.git
tests: Key regress.c's Windows portability macros on _WIN32
TEST_NULL_DEVICE, TEST_SETENV, TEST_UNSETENV, and TEST_MKDIR were gated on USE_WINDOWS_API, while the arpa/inet.h/direct.h include guard a few lines above keys on _WIN32. Whether mkdir(), setenv(), and /dev/null work as expected is a libc availability question, not a wolfSSH API-selection one, so _WIN32 is the more direct fit and now both guards in this file agree. No behavior change: USE_WINDOWS_API is only ever set when _WIN32 is already defined, so this does not change which branch any current build takes. Verified with the MinGW cross compiler both with WOLFSSH_SFTP defined and without, and confirmed a plain Linux build still passes tests/regress.test and tests/unit.test.pull/1247/head
parent
0bb371a4b2
commit
343582a61e
|
|
@ -9380,8 +9380,10 @@ static void TestClientBuffersIdempotent(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* Windows has no /dev/null; the null device there is "NUL". */
|
||||
#ifdef USE_WINDOWS_API
|
||||
/* Windows has no /dev/null; the null device there is "NUL". Keyed on
|
||||
* _WIN32, like the arpa/inet.h/direct.h include guard above: this is a
|
||||
* libc-availability question, not a wolfSSH API-selection one. */
|
||||
#ifdef _WIN32
|
||||
#define TEST_NULL_DEVICE "NUL"
|
||||
#else
|
||||
#define TEST_NULL_DEVICE "/dev/null"
|
||||
|
|
@ -13371,8 +13373,10 @@ static int KnownHostsCheckCapture(const byte* pubKey, word32 pubKeySz,
|
|||
* enough for this test's own HOME juggling. WMKDIR is not an option here:
|
||||
* it is only defined when wolfssh/port.h is built with SFTP, SCP, or sshd
|
||||
* support, and this test compiles whenever WOLFSSL_BASE64_ENCODE is set,
|
||||
* independent of those. */
|
||||
#ifdef USE_WINDOWS_API
|
||||
* independent of those. Keyed on _WIN32 rather than USE_WINDOWS_API for
|
||||
* the same reason as TEST_NULL_DEVICE above: mkdir()/setenv() availability
|
||||
* is a libc question. */
|
||||
#ifdef _WIN32
|
||||
#define TEST_SETENV(n,v) _putenv_s((n), (v))
|
||||
#define TEST_UNSETENV(n) _putenv_s((n), "")
|
||||
#define TEST_MKDIR(p,m) _mkdir((p))
|
||||
|
|
|
|||
Loading…
Reference in New Issue