From 9bc3da7fa7d3f9c59f9fb809947ebdbf9cdf0f00 Mon Sep 17 00:00:00 2001 From: Manoj Ampalam Date: Fri, 27 Jan 2017 14:11:27 -0800 Subject: [PATCH] Cleaned up unittests (https://github.com/PowerShell/Win32-OpenSSH/issues/477) unittest-sshkey.exe failures still need investigation --- contrib/win32/openssh/Win32-OpenSSH.sln | 13 +- contrib/win32/openssh/config.h.vs | 2 +- contrib/win32/openssh/unittest-match.vcxproj | 214 +++++++++++++++++++ contrib/win32/win32compat/socketio.c | 2 + regress/unittests/hostkeys/test_iterate.c | 10 +- regress/unittests/kex/test_kex.c | 2 +- regress/unittests/sshkey/test_file.c | 15 +- regress/unittests/sshkey/test_fuzz.c | 12 +- regress/unittests/sshkey/test_sshkey.c | 6 +- regress/unittests/test_helper/test_helper.c | 6 - regress/unittests/utf8/tests.c | 16 +- regress/unittests/win32compat/socket_tests.c | 2 +- 12 files changed, 253 insertions(+), 47 deletions(-) create mode 100644 contrib/win32/openssh/unittest-match.vcxproj diff --git a/contrib/win32/openssh/Win32-OpenSSH.sln b/contrib/win32/openssh/Win32-OpenSSH.sln index ee8c928b7..bd5a115b6 100644 --- a/contrib/win32/openssh/Win32-OpenSSH.sln +++ b/contrib/win32/openssh/Win32-OpenSSH.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 +VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssh", "ssh.vcxproj", "{74E69D5E-A1EF-46EA-9173-19A412774104}" ProjectSection(ProjectDependencies) = postProject @@ -137,6 +137,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{17322AAF-8 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A8096E32-E084-4FA0-AE01-A8D909EB2BB4}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unittest-match", "unittest-match.vcxproj", "{484A8CDE-B949-4BDA-B447-74685C8E032F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -313,6 +315,14 @@ Global {FC568FF0-60F2-4B2E-AF62-FD392EDBA1B9}.Release|x64.Build.0 = Release|x64 {FC568FF0-60F2-4B2E-AF62-FD392EDBA1B9}.Release|x86.ActiveCfg = Release|Win32 {FC568FF0-60F2-4B2E-AF62-FD392EDBA1B9}.Release|x86.Build.0 = Release|Win32 + {484A8CDE-B949-4BDA-B447-74685C8E032F}.Debug|x64.ActiveCfg = Debug|x64 + {484A8CDE-B949-4BDA-B447-74685C8E032F}.Debug|x64.Build.0 = Debug|x64 + {484A8CDE-B949-4BDA-B447-74685C8E032F}.Debug|x86.ActiveCfg = Debug|Win32 + {484A8CDE-B949-4BDA-B447-74685C8E032F}.Debug|x86.Build.0 = Debug|Win32 + {484A8CDE-B949-4BDA-B447-74685C8E032F}.Release|x64.ActiveCfg = Release|x64 + {484A8CDE-B949-4BDA-B447-74685C8E032F}.Release|x64.Build.0 = Release|x64 + {484A8CDE-B949-4BDA-B447-74685C8E032F}.Release|x86.ActiveCfg = Release|Win32 + {484A8CDE-B949-4BDA-B447-74685C8E032F}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -339,5 +349,6 @@ Global {114CAA59-46C0-4B87-BA86-C1946A68101D} = {A8096E32-E084-4FA0-AE01-A8D909EB2BB4} {890C6129-286F-4CD8-8252-FB8D3B4E6E1B} = {A8096E32-E084-4FA0-AE01-A8D909EB2BB4} {FC568FF0-60F2-4B2E-AF62-FD392EDBA1B9} = {A8096E32-E084-4FA0-AE01-A8D909EB2BB4} + {484A8CDE-B949-4BDA-B447-74685C8E032F} = {A8096E32-E084-4FA0-AE01-A8D909EB2BB4} EndGlobalSection EndGlobal diff --git a/contrib/win32/openssh/config.h.vs b/contrib/win32/openssh/config.h.vs index 84bb0e2f0..edcd5610a 100644 --- a/contrib/win32/openssh/config.h.vs +++ b/contrib/win32/openssh/config.h.vs @@ -1332,6 +1332,7 @@ /* libcrypto includes complete ECC support */ #define OPENSSL_HAS_ECC 1 +#define OPENSSL_HAS_NISTP521 1 /* libcrypto is missing AES 192 and 256 bit functions */ /* #undef OPENSSL_LOBOTOMISED_AES */ @@ -1580,7 +1581,6 @@ #define WIN32_LEAN_AND_MEAN 1 #define _CRT_SECURE_NO_DEPRECATE 1 #define _CRT_NONSTDC_NO_DEPRECATE 1 -#define WIN32_FIXME 1 #define WINDOWS 1 /* Define if you must implement a startup_needs function for your platform */ diff --git a/contrib/win32/openssh/unittest-match.vcxproj b/contrib/win32/openssh/unittest-match.vcxproj new file mode 100644 index 000000000..c87491804 --- /dev/null +++ b/contrib/win32/openssh/unittest-match.vcxproj @@ -0,0 +1,214 @@ + + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {484A8CDE-B949-4BDA-B447-74685C8E032F} + Win32Proj + Win32OpenSSH + 8.1 + unittest-match + + + + Application + true + v140 + MultiByte + + + Application + true + v140 + MultiByte + + + Application + false + v140 + true + MultiByte + + + Application + false + v140 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + false + $(Platform)\$(Configuration)\$(TargetName)\ + unittest-match + $(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\ + $(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath); + + + false + $(Platform)\$(Configuration)\$(TargetName)\ + unittest-match + $(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\ + $(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath); + + + false + $(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\$(TargetName)\ + unittest-match + $(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath); + + + false + $(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\$(TargetName)\ + unittest-match + $(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath); + + + + NotUsing + Level1 + Disabled + _WIN32_WINNT=0x600;WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + false + $(SolutionDir);$(OpenSSL-Win32-Debug-Path)include;$(OpenSSH-Src-Path)includes;$(OpenSSH-Src-Path);$(OpenSSH-Src-Path)contrib\win32\win32compat;$(OpenSSH-Src-Path)libkrb;$(OpenSSH-Src-Path)libkrb\libKrb5;%(AdditionalIncludeDirectories) + CompileAsC + MultiThreadedDebug + Sync + ProgramDatabase + + + Console + true + $(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-Win32-Debug-Path)lib;%(AdditionalLibraryDirectories) + Netapi32.lib;posix_compat.lib;bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;libeay32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + wmainCRTStartup + + + targetos.manifest + + + + + NotUsing + Level1 + Disabled + _WIN32_WINNT=0x600;WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + false + $(SolutionDir);$(OpenSSL-x64-Debug-Path)include;$(OpenSSH-Src-Path)includes;$(OpenSSH-Src-Path);$(OpenSSH-Src-Path)contrib\win32\win32compat;$(OpenSSH-Src-Path)libkrb;$(OpenSSH-Src-Path)libkrb\libKrb5;%(AdditionalIncludeDirectories) + CompileAsC + MultiThreadedDebug + ProgramDatabase + + + Console + true + $(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-x64-Debug-Path)lib;%(AdditionalLibraryDirectories) + Netapi32.lib;posix_compat.lib;bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;libeay32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + wmainCRTStartup + + + targetos.manifest + + + + + Level1 + NotUsing + MaxSpeed + true + true + _WIN32_WINNT=0x600;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + false + $(SolutionDir);$(OpenSSL-Win32-Release-Path)include;$(OpenSSH-Src-Path)includes;$(OpenSSH-Src-Path);$(OpenSSH-Src-Path)contrib\win32\win32compat;$(OpenSSH-Src-Path)libkrb;$(OpenSSH-Src-Path)libkrb\libKrb5;%(AdditionalIncludeDirectories) + MultiThreaded + + + Console + No + true + true + $(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-Win32-Release-Path)lib;%(AdditionalLibraryDirectories) + Netapi32.lib;posix_compat.lib;bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;libeay32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + wmainCRTStartup + + + targetos.manifest + + + + + Level1 + NotUsing + MaxSpeed + true + true + _WIN32_WINNT=0x600;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + false + $(SolutionDir);$(OpenSSL-x64-Release-Path)include;$(OpenSSH-Src-Path)includes;$(OpenSSH-Src-Path);$(OpenSSH-Src-Path)contrib\win32\win32compat;$(OpenSSH-Src-Path)libkrb;$(OpenSSH-Src-Path)libkrb\libKrb5;%(AdditionalIncludeDirectories) + MultiThreaded + true + + + Console + No + true + true + $(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-x64-Release-Path)lib;%(AdditionalLibraryDirectories) + Netapi32.lib;posix_compat.lib;bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;libeay32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + wmainCRTStartup + + + targetos.manifest + + + + + true + + + true + + + true + + + + + + \ No newline at end of file diff --git a/contrib/win32/win32compat/socketio.c b/contrib/win32/win32compat/socketio.c index c687ea3b6..c4ba4948a 100644 --- a/contrib/win32/win32compat/socketio.c +++ b/contrib/win32/win32compat/socketio.c @@ -57,6 +57,8 @@ int errno_from_WSAError(int wsaerrno) return EINVAL; case WSAECONNABORTED: return ECONNABORTED; + case WSAETIMEDOUT: + return ETIMEDOUT; case WSAECONNREFUSED: return ECONNREFUSED; case WSAEINPROGRESS: diff --git a/regress/unittests/hostkeys/test_iterate.c b/regress/unittests/hostkeys/test_iterate.c index 95f149f9d..38cf32be4 100644 --- a/regress/unittests/hostkeys/test_iterate.c +++ b/regress/unittests/hostkeys/test_iterate.c @@ -62,9 +62,7 @@ check(struct hostkey_foreach_line *l, void *_ctx) test_subtest_info("entry %zu/%zu, file line %ld", ctx->i + 1, ctx->nexpected, l->linenum); for (;;) { -#ifndef WIN32_FIXME - //ASSERT_SIZE_T_LT(ctx->i, ctx->nexpected); -#endif + ASSERT_SIZE_T_LT(ctx->i, ctx->nexpected); expected = ctx->expected + ctx->i++; /* If we are matching host/IP then skip entries that don't */ if (!matching) @@ -114,7 +112,6 @@ check(struct hostkey_foreach_line *l, void *_ctx) UPDATE_MATCH_STATUS(match_ipv6); ASSERT_PTR_NE(l->path, NULL); /* Don't care about path */ -#ifndef WIN32_FIXME ASSERT_LONG_LONG_EQ(l->linenum, expected->l.linenum); ASSERT_U_INT_EQ(l->status, expected_status); ASSERT_U_INT_EQ(l->match, expected_match); @@ -140,7 +137,6 @@ check(struct hostkey_foreach_line *l, void *_ctx) } if (parse_key && !(l->comment == NULL && expected->l.comment == NULL)) ASSERT_STRING_EQ(l->comment, expected->l.comment); -#endif return 0; } @@ -285,7 +281,7 @@ struct expected expected_full[] = { NULL, /* filled at runtime */ "DSA #2", } }, -#ifndef WIN32_FIXME +#ifdef OPENSSL_HAS_NISTP521 { "ecdsa_2.pub" , -1, -1, HKF_MATCH_HOST, 0, HKF_MATCH_IP, HKF_MATCH_IP, -1, { NULL, 10, @@ -812,7 +808,6 @@ struct expected expected_full[] = { NULL, /* filled at runtime */ "ECDSA #4", } }, -#ifndef WIN32_FIXME { "dsa_4.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, 0, 0, -1, { NULL, 50, @@ -826,7 +821,6 @@ struct expected expected_full[] = { NULL, /* filled at runtime */ "DSA #4", } }, -#endif { NULL, -1, -1, 0, 0, 0, 0, -1, { NULL, 51, diff --git a/regress/unittests/kex/test_kex.c b/regress/unittests/kex/test_kex.c index e7221e015..5bb9a2f88 100644 --- a/regress/unittests/kex/test_kex.c +++ b/regress/unittests/kex/test_kex.c @@ -195,7 +195,7 @@ kex_tests(void) #ifdef OPENSSL_HAS_ECC do_kex("ecdh-sha2-nistp256"); do_kex("ecdh-sha2-nistp384"); -#ifndef WIN32_FIXME +#ifdef OPENSSL_HAS_NISTP521 do_kex("ecdh-sha2-nistp521"); #endif #endif diff --git a/regress/unittests/sshkey/test_file.c b/regress/unittests/sshkey/test_file.c index a47a9c10d..cebe0e980 100644 --- a/regress/unittests/sshkey/test_file.c +++ b/regress/unittests/sshkey/test_file.c @@ -136,7 +136,7 @@ sshkey_file_tests(void) ASSERT_INT_EQ(sshkey_equal(k1, k2), 1); sshkey_free(k2); TEST_DONE(); -#ifndef WIN32_FIXME + TEST_START("parse RSA from new-format w/ passphrase"); buf = load_file("rsa_n_pw"); ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, @@ -146,7 +146,7 @@ sshkey_file_tests(void) ASSERT_INT_EQ(sshkey_equal(k1, k2), 1); sshkey_free(k2); TEST_DONE(); -#endif + TEST_START("load RSA from public"); ASSERT_INT_EQ(sshkey_load_public(test_data_file("rsa_1.pub"), &k2, NULL), 0); @@ -228,7 +228,6 @@ sshkey_file_tests(void) sshkey_free(k2); TEST_DONE(); -#ifndef WIN32_FIXME TEST_START("parse DSA from new-format w/ passphrase"); buf = load_file("dsa_n_pw"); ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, @@ -238,7 +237,7 @@ sshkey_file_tests(void) ASSERT_INT_EQ(sshkey_equal(k1, k2), 1); sshkey_free(k2); TEST_DONE(); -#endif + TEST_START("load DSA from public"); ASSERT_INT_EQ(sshkey_load_public(test_data_file("dsa_1.pub"), &k2, NULL), 0); @@ -327,7 +326,7 @@ sshkey_file_tests(void) ASSERT_INT_EQ(sshkey_equal(k1, k2), 1); sshkey_free(k2); TEST_DONE(); -#ifndef WIN32_FIXME + TEST_START("parse ECDSA from new-format w/ passphrase"); buf = load_file("ecdsa_n_pw"); ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, @@ -337,7 +336,7 @@ sshkey_file_tests(void) ASSERT_INT_EQ(sshkey_equal(k1, k2), 1); sshkey_free(k2); TEST_DONE(); -#endif + TEST_START("load ECDSA from public"); ASSERT_INT_EQ(sshkey_load_public(test_data_file("ecdsa_1.pub"), &k2, NULL), 0); @@ -384,7 +383,7 @@ sshkey_file_tests(void) sshkey_free(k1); #endif /* OPENSSL_HAS_ECC */ -#ifndef WIN32_FIXME + TEST_START("parse Ed25519 from private"); buf = load_file("ed25519_1"); ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", &k1, NULL), 0); @@ -451,5 +450,5 @@ sshkey_file_tests(void) sshkey_free(k1); sshbuf_free(pw); -#endif + } diff --git a/regress/unittests/sshkey/test_fuzz.c b/regress/unittests/sshkey/test_fuzz.c index 3f8879f25..1f414e0ac 100644 --- a/regress/unittests/sshkey/test_fuzz.c +++ b/regress/unittests/sshkey/test_fuzz.c @@ -269,7 +269,7 @@ sshkey_fuzz_tests(void) fuzz_cleanup(fuzz); TEST_DONE(); #endif -#ifndef WIN32_FIXME + TEST_START("fuzz Ed25519 private"); buf = load_file("ed25519_1"); fuzz = fuzz_begin(FUZZ_BASE64, sshbuf_mutable_ptr(buf), @@ -289,7 +289,7 @@ sshkey_fuzz_tests(void) sshbuf_free(fuzzed); fuzz_cleanup(fuzz); TEST_DONE(); -#endif + TEST_START("fuzz RSA public"); buf = load_file("rsa_1"); ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", &k1, NULL), 0); @@ -333,7 +333,7 @@ sshkey_fuzz_tests(void) sshkey_free(k1); TEST_DONE(); #endif -#ifndef WIN32_FIXME + TEST_START("fuzz Ed25519 public"); buf = load_file("ed25519_1"); ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", &k1, NULL), 0); @@ -347,7 +347,7 @@ sshkey_fuzz_tests(void) public_fuzz(k1); sshkey_free(k1); TEST_DONE(); -#endif + TEST_START("fuzz RSA sig"); buf = load_file("rsa_1"); ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", &k1, NULL), 0); @@ -389,7 +389,7 @@ sshkey_fuzz_tests(void) sshkey_free(k1); TEST_DONE(); #endif -#ifndef WIN32_FIXME + TEST_START("fuzz Ed25519 sig"); buf = load_file("ed25519_1"); ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", &k1, NULL), 0); @@ -397,7 +397,7 @@ sshkey_fuzz_tests(void) sig_fuzz(k1, NULL); sshkey_free(k1); TEST_DONE(); -#endif + /* XXX fuzz decoded new-format blobs too */ } diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c index 7a987f6fa..b6aae8326 100644 --- a/regress/unittests/sshkey/test_sshkey.c +++ b/regress/unittests/sshkey/test_sshkey.c @@ -429,8 +429,7 @@ sshkey_tests(void) #endif sshkey_free(kf); -#ifndef WIN32_FIXME - TEST_START("certify key"); + TEST_START("certify key"); ASSERT_INT_EQ(sshkey_load_public(test_data_file("ed25519_1.pub"), &k1, NULL), 0); k2 = get_private("ed25519_2"); @@ -472,7 +471,6 @@ sshkey_tests(void) sshkey_free(k3); sshbuf_reset(b); TEST_DONE(); -#endif TEST_START("sign and verify RSA"); k1 = get_private("rsa_1"); @@ -512,7 +510,6 @@ sshkey_tests(void) #ifdef OPENSSL_HAS_ECC -#ifndef WIN32_FIXME TEST_START("sign and verify ECDSA"); k1 = get_private("ecdsa_1"); ASSERT_INT_EQ(sshkey_load_public(test_data_file("ecdsa_2.pub"), &k2, @@ -546,5 +543,4 @@ sshkey_tests(void) sshbuf_free(b); TEST_DONE(); #endif -#endif } diff --git a/regress/unittests/test_helper/test_helper.c b/regress/unittests/test_helper/test_helper.c index 9e83e3079..26ca26b5e 100644 --- a/regress/unittests/test_helper/test_helper.c +++ b/regress/unittests/test_helper/test_helper.c @@ -116,12 +116,6 @@ static void *onerror_ctx = NULL; static const char *data_dir = NULL; static char subtest_info[512]; -#ifndef WIN32_FIXME -void fatal(const char *fmt,...) {/*stub*/} -void logit(const char *fmt,...) {/*stub*/} -void debug3(const char *fmt,...) {/*stub*/} -#endif - int main(int argc, char **argv) { diff --git a/regress/unittests/utf8/tests.c b/regress/unittests/utf8/tests.c index 32c6171bc..cd88a4233 100644 --- a/regress/unittests/utf8/tests.c +++ b/regress/unittests/utf8/tests.c @@ -59,12 +59,14 @@ tests(void) { char *loc; +#ifdef WINDOWS + TEST_START("not applicable to Windows yet"); + TEST_DONE(); + return; +#endif + TEST_START("utf8_setlocale"); -#ifdef WIN32_FIXME - loc = setlocale(LC_CTYPE, "English"); -#else loc = setlocale(LC_CTYPE, "en_US.UTF-8"); -#endif ASSERT_PTR_NE(loc, NULL); TEST_DONE(); @@ -74,20 +76,14 @@ tests(void) one("newline", "a\nb", -2, -2, -2, "a\nb"); one("cr", "a\rb", -2, -2, -2, "a\rb"); one("tab", "a\tb", -2, -2, -2, "a\tb"); -#ifndef WIN32_FIXME one("esc", "\033x", -2, -2, -2, "\\033x"); one("inv_badbyte", "\377x", -2, -2, -2, "\\377x"); one("inv_nocont", "\341x", -2, -2, -2, "\\341x"); one("inv_nolead", "a\200b", -2, -2, -2, "a\\200b"); -#endif one("sz_ascii", "1234567890123456", -2, -2, 16, "123456789012345"); -#ifndef WIN32_FIXME one("sz_esc", "123456789012\033", -2, -2, 16, "123456789012"); -#endif one("width_ascii", "123", 2, 2, -1, "12"); one("width_double", "a\343\201\201", 2, 1, -1, "a"); -#ifndef WIN32_FIXME one("double_fit", "a\343\201\201", 3, 3, 4, "a\343\201\201"); one("double_spc", "a\343\201\201", 4, 3, 4, "a\343\201\201"); -#endif } diff --git a/regress/unittests/win32compat/socket_tests.c b/regress/unittests/win32compat/socket_tests.c index 98ba10535..e9e2182e5 100644 --- a/regress/unittests/win32compat/socket_tests.c +++ b/regress/unittests/win32compat/socket_tests.c @@ -387,7 +387,7 @@ socket_nonblocking_io_tests() void socket_select_tests() { int s, r; - int num_bytes = 1024 * 700; //700KB + int num_bytes = 1024 * 1024 * 2; //2 MB int bytes_sent = 0; int bytes_received = 0; int seed = 326;