crypt32/tests: Use GetModuleHandle and skip.
This commit is contained in:
parent
9a0e666733
commit
68fec9028c
|
@ -132,8 +132,6 @@ static void testBinaryToStringA(void)
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
DWORD strLen = 0, i;
|
DWORD strLen = 0, i;
|
||||||
|
|
||||||
if (!pCryptBinaryToStringA) return;
|
|
||||||
|
|
||||||
ret = pCryptBinaryToStringA(NULL, 0, 0, NULL, NULL);
|
ret = pCryptBinaryToStringA(NULL, 0, 0, NULL, NULL);
|
||||||
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
|
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||||
|
@ -320,8 +318,6 @@ static void testStringToBinaryA(void)
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
DWORD bufLen = 0, i;
|
DWORD bufLen = 0, i;
|
||||||
|
|
||||||
if (!pCryptStringToBinaryA) return;
|
|
||||||
|
|
||||||
ret = pCryptStringToBinaryA(NULL, 0, 0, NULL, NULL, NULL, NULL);
|
ret = pCryptStringToBinaryA(NULL, 0, 0, NULL, NULL, NULL, NULL);
|
||||||
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
|
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||||
|
@ -443,7 +439,7 @@ static void testStringToBinaryA(void)
|
||||||
|
|
||||||
START_TEST(base64)
|
START_TEST(base64)
|
||||||
{
|
{
|
||||||
HMODULE lib = LoadLibraryA("crypt32");
|
HMODULE lib = GetModuleHandleA("crypt32");
|
||||||
|
|
||||||
if (lib)
|
if (lib)
|
||||||
{
|
{
|
||||||
|
@ -452,9 +448,14 @@ START_TEST(base64)
|
||||||
pCryptStringToBinaryA = (CryptStringToBinaryAFunc)GetProcAddress(lib,
|
pCryptStringToBinaryA = (CryptStringToBinaryAFunc)GetProcAddress(lib,
|
||||||
"CryptStringToBinaryA");
|
"CryptStringToBinaryA");
|
||||||
|
|
||||||
testBinaryToStringA();
|
if (pCryptBinaryToStringA)
|
||||||
testStringToBinaryA();
|
testBinaryToStringA();
|
||||||
|
else
|
||||||
|
skip("CryptBinaryToStringA is not available\n");
|
||||||
|
|
||||||
FreeLibrary(lib);
|
if (pCryptStringToBinaryA)
|
||||||
|
testStringToBinaryA();
|
||||||
|
else
|
||||||
|
skip("CryptStringToBinaryA is not available\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue