Commit eb00dbd9 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

crypt32/tests: Detect missing HEXRAW support by output.

parent 6ee109c5
...@@ -363,11 +363,16 @@ static void test_CryptBinaryToString(void) ...@@ -363,11 +363,16 @@ static void test_CryptBinaryToString(void)
heap_free(encodedW); heap_free(encodedW);
} }
/* winxp and win2k3 are documented as not handling HEXRAW but do not return failure */ /* Systems that don't support HEXRAW format convert to BASE64 instead - 3 bytes in -> 4 chars + crlf + 1 null out. */
GetVersionExA(&ver); strLen = 0;
if (ver.dwMajorVersion <= 5) 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; return;
} }
...@@ -376,6 +381,12 @@ static void test_CryptBinaryToString(void) ...@@ -376,6 +381,12 @@ static void test_CryptBinaryToString(void)
for (i = 0; i < ARRAY_SIZE(flags); i++) 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; strLen = ~0;
ret = CryptBinaryToStringW(input, sizeof(input), CRYPT_STRING_HEXRAW|flags[i], ret = CryptBinaryToStringW(input, sizeof(input), CRYPT_STRING_HEXRAW|flags[i],
NULL, &strLen); NULL, &strLen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment