Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- 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);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/crypt32/base64.c | 11 +++++++---- dlls/crypt32/tests/base64.c | 5 +---- 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/crypt32/base64.c b/dlls/crypt32/base64.c index 221b452d7e..73619421ab 100644 --- a/dlls/crypt32/base64.c +++ b/dlls/crypt32/base64.c @@ -490,16 +490,19 @@ static BOOL BinaryToHexW(const BYTE *bin, DWORD nbin, DWORD flags, LPWSTR str, D needed = 2;
needed += nbin * 2 + 1; + + if (!str) + { + *nstr = needed; + return TRUE; + } + if (needed > *nstr) { SetLastError(ERROR_MORE_DATA); return FALSE; }
- *nstr = needed; - if (!str) - return TRUE; - while (nbin--) { *str++ = hex[(*bin >> 4) & 0xf]; diff --git a/dlls/crypt32/tests/base64.c b/dlls/crypt32/tests/base64.c index 874f8e432d..7b9f4c1077 100644 --- a/dlls/crypt32/tests/base64.c +++ b/dlls/crypt32/tests/base64.c @@ -366,10 +366,8 @@ static void test_CryptBinaryToString(void) /* 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(HEXRAW) not supported\n"); @@ -383,10 +381,9 @@ todo_wine { { 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);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64913
Your paranoid android.
=== wxppro (32 bit report) ===
=== w2008s64 (32 bit report) ===
=== w8 (32 bit report) ===
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== w1064v1809_zh_CN (32 bit report) ===
=== w2008s64 (64 bit report) ===
=== w864 (64 bit report) ===
=== w1064v1507 (64 bit report) ===
=== w1064v1809 (64 bit report) ===
=== debian10 (32 bit report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?) crypt32:cert has no test summary line (early exit of the main process?) crypt32:chain has no test summary line (early exit of the main process?) crypt32:crl has no test summary line (early exit of the main process?) crypt32:ctl has no test summary line (early exit of the main process?) crypt32:encode has no test summary line (early exit of the main process?) crypt32:main has no test summary line (early exit of the main process?) crypt32:message has no test summary line (early exit of the main process?) crypt32:msg has no test summary line (early exit of the main process?) crypt32:object has no test summary line (early exit of the main process?) crypt32:oid has no test summary line (early exit of the main process?) crypt32:protectdata has no test summary line (early exit of the main process?) crypt32:sip has no test summary line (early exit of the main process?) crypt32:store has no test summary line (early exit of the main process?) crypt32:str has no test summary line (early exit of the main process?)
=== debian10 (32 bit French report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== debian10 (32 bit Japanese:Japan report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== debian10 (32 bit Chinese:China report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?) crypt32:cert has no test summary line (early exit of the main process?) crypt32:chain has no test summary line (early exit of the main process?) crypt32:crl has no test summary line (early exit of the main process?) crypt32:ctl has no test summary line (early exit of the main process?) crypt32:encode has no test summary line (early exit of the main process?) crypt32:main has no test summary line (early exit of the main process?) crypt32:message has no test summary line (early exit of the main process?) crypt32:msg has no test summary line (early exit of the main process?) crypt32:object has no test summary line (early exit of the main process?) crypt32:oid has no test summary line (early exit of the main process?) crypt32:protectdata has no test summary line (early exit of the main process?) crypt32:sip has no test summary line (early exit of the main process?) crypt32:store has no test summary line (early exit of the main process?) crypt32:str has no test summary line (early exit of the main process?)
=== debian10 (32 bit WoW report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?) crypt32:cert has no test summary line (early exit of the main process?) crypt32:chain has no test summary line (early exit of the main process?) crypt32:crl has no test summary line (early exit of the main process?) crypt32:ctl has no test summary line (early exit of the main process?) crypt32:encode has no test summary line (early exit of the main process?) crypt32:main has no test summary line (early exit of the main process?) crypt32:message has no test summary line (early exit of the main process?) crypt32:msg has no test summary line (early exit of the main process?) crypt32:object has no test summary line (early exit of the main process?) crypt32:oid has no test summary line (early exit of the main process?) crypt32:protectdata has no test summary line (early exit of the main process?) crypt32:sip has no test summary line (early exit of the main process?) crypt32:store has no test summary line (early exit of the main process?) crypt32:str has no test summary line (early exit of the main process?)
=== debian10 (64 bit WoW report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?) crypt32:cert has no test summary line (early exit of the main process?) crypt32:chain has no test summary line (early exit of the main process?) crypt32:crl has no test summary line (early exit of the main process?) crypt32:ctl has no test summary line (early exit of the main process?) crypt32:encode has no test summary line (early exit of the main process?) crypt32:main has no test summary line (early exit of the main process?) crypt32:message has no test summary line (early exit of the main process?) crypt32:msg has no test summary line (early exit of the main process?) crypt32:object has no test summary line (early exit of the main process?) crypt32:oid has no test summary line (early exit of the main process?) crypt32:protectdata has no test summary line (early exit of the main process?) crypt32:sip has no test summary line (early exit of the main process?) crypt32:store has no test summary line (early exit of the main process?) crypt32:str has no test summary line (early exit of the main process?)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64912
Your paranoid android.
=== wxppro (32 bit report) ===
=== w2008s64 (32 bit report) ===
=== w8 (32 bit report) ===
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== w1064v1809_zh_CN (32 bit report) ===
=== w2008s64 (64 bit report) ===
=== w864 (64 bit report) ===
=== w1064v1507 (64 bit report) ===
=== w1064v1809 (64 bit report) ===
=== debian10 (32 bit report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== debian10 (32 bit French report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== debian10 (32 bit Japanese:Japan report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== debian10 (32 bit Chinese:China report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== debian10 (32 bit WoW report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)
=== debian10 (64 bit WoW report) ===
Report validation errors: crypt32:base64 has no test summary line (early exit of the main process?)