mirror of
https://github.com/reactos/wine.git
synced 2025-02-23 22:40:55 +00:00
crypt32: Fix some test failures on Win9x/NT4.
This commit is contained in:
parent
558057b4b2
commit
3fdf6024a2
@ -469,7 +469,8 @@ static void testTimeEncoding(DWORD dwEncoding, LPCSTR structType,
|
||||
}
|
||||
}
|
||||
else
|
||||
ok((!ret && GetLastError() == CRYPT_E_BAD_ENCODE) || broken(ret),
|
||||
ok((!ret && GetLastError() == CRYPT_E_BAD_ENCODE) ||
|
||||
broken(GetLastError() == ERROR_SUCCESS),
|
||||
"Expected CRYPT_E_BAD_ENCODE, got 0x%08x\n", GetLastError());
|
||||
}
|
||||
|
||||
@ -498,13 +499,20 @@ static void compareTime(const SYSTEMTIME *expected, const FILETIME *got)
|
||||
SYSTEMTIME st;
|
||||
|
||||
FileTimeToSystemTime(got, &st);
|
||||
ok(expected->wYear == st.wYear &&
|
||||
ok((expected->wYear == st.wYear &&
|
||||
expected->wMonth == st.wMonth &&
|
||||
expected->wDay == st.wDay &&
|
||||
expected->wHour == st.wHour &&
|
||||
expected->wMinute == st.wMinute &&
|
||||
expected->wSecond == st.wSecond &&
|
||||
abs(expected->wMilliseconds - st.wMilliseconds) <= 1,
|
||||
abs(expected->wMilliseconds - st.wMilliseconds) <= 1) ||
|
||||
/* Some Windows systems only seem to be accurate in their time decoding to
|
||||
* within about an hour.
|
||||
*/
|
||||
broken(expected->wYear == st.wYear &&
|
||||
expected->wMonth == st.wMonth &&
|
||||
expected->wDay == st.wDay &&
|
||||
abs(expected->wHour - st.wHour) <= 1),
|
||||
"Got unexpected value for time decoding:\nexpected %s, got %s\n",
|
||||
printSystemTime(expected), printFileTime(got));
|
||||
}
|
||||
@ -524,7 +532,8 @@ static void testTimeDecoding(DWORD dwEncoding, LPCSTR structType,
|
||||
if (structType == X509_CHOICE_OF_TIME ||
|
||||
(time->sysTime.wYear >= 1950 && time->sysTime.wYear <= 2050))
|
||||
{
|
||||
ok(ret, "CryptDecodeObjectEx failed: %d (0x%08x)\n", GetLastError(),
|
||||
ok(ret || broken(GetLastError() == OSS_DATA_ERROR),
|
||||
"CryptDecodeObjectEx failed: %d (0x%08x)\n", GetLastError(),
|
||||
GetLastError());
|
||||
if (ret)
|
||||
compareTime(&time->sysTime, &ft);
|
||||
|
Loading…
x
Reference in New Issue
Block a user