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)
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);
......
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