Nikolay Sivov : crypt32/tests: Detect missing HEXRAW support by output.
Module: wine Branch: master Commit: eb00dbd9134783242d0e3c21be8f5fafd4519d70 URL: https://source.winehq.org/git/wine.git/?a=commit;h=eb00dbd9134783242d0e3c21b... Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Feb 11 12:25:39 2020 +0300 crypt32/tests: Detect missing HEXRAW support by output. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/tests/base64.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/dlls/crypt32/tests/base64.c b/dlls/crypt32/tests/base64.c index ac41d5c86d..874f8e432d 100644 --- a/dlls/crypt32/tests/base64.c +++ b/dlls/crypt32/tests/base64.c @@ -363,11 +363,16 @@ static void test_CryptBinaryToString(void) heap_free(encodedW); } - /* winxp and win2k3 are documented as not handling HEXRAW but do not return failure */ - GetVersionExA(&ver); - if (ver.dwMajorVersion <= 5) + /* Systems that don't support HEXRAW format convert to BASE64 instead - 3 bytes in -> 4 chars + crlf + 1 null out. */ + strLen = 0; + ret = CryptBinaryToStringW(input, 3, CRYPT_STRING_HEXRAW, NULL, &strLen); +todo_wine { + ok(ret, "Failed to get string length.\n"); + ok(strLen == 9 || broken(strLen == 7), "Unexpected string length %d.\n", strLen); +} + if (strLen == 7) { - win_skip("CryptBinaryToString(HEX) not supported\n"); + win_skip("CryptBinaryToString(HEXRAW) not supported\n"); return; } @@ -376,6 +381,12 @@ static void test_CryptBinaryToString(void) for (i = 0; i < ARRAY_SIZE(flags); i++) { + strLen = 0; + ret = CryptBinaryToStringW(input, sizeof(input), CRYPT_STRING_HEXRAW|flags[i], NULL, &strLen); +todo_wine { + ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError()); + ok(strLen > 0, "Unexpected string length.\n"); +} strLen = ~0; ret = CryptBinaryToStringW(input, sizeof(input), CRYPT_STRING_HEXRAW|flags[i], NULL, &strLen);
participants (1)
-
Alexandre Julliard