Commit 72848b7b authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Fix a few test failures on some Windows 98 systems.

parent 58c6467c
...@@ -156,7 +156,8 @@ static void testCreateCTL(void) ...@@ -156,7 +156,8 @@ static void testCreateCTL(void)
signedCTLWithSubjectAlgorithm, sizeof(signedCTLWithSubjectAlgorithm)); signedCTLWithSubjectAlgorithm, sizeof(signedCTLWithSubjectAlgorithm));
ok(!ctl && ok(!ctl &&
(GetLastError() == ERROR_INVALID_DATA || (GetLastError() == ERROR_INVALID_DATA ||
GetLastError() == CRYPT_E_UNEXPECTED_MSG_TYPE), /* win9x */ GetLastError() == CRYPT_E_UNEXPECTED_MSG_TYPE /* win9x */ ||
GetLastError() == ERROR_SUCCESS /* some win98 */),
"expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(), "expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(),
GetLastError()); GetLastError());
/* This signed CTL with the appropriate inner content type can be decoded. /* This signed CTL with the appropriate inner content type can be decoded.
...@@ -326,7 +327,7 @@ static void testAddCTLToStore(void) ...@@ -326,7 +327,7 @@ static void testAddCTLToStore(void)
{ {
HCERTSTORE store; HCERTSTORE store;
BOOL ret; BOOL ret;
DWORD numCTLs; DWORD numCTLs, expectedCTLs;
PCCTL_CONTEXT ctl; PCCTL_CONTEXT ctl;
store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
...@@ -368,7 +369,8 @@ static void testAddCTLToStore(void) ...@@ -368,7 +369,8 @@ static void testAddCTLToStore(void)
if (ret) if (ret)
{ {
/* win9x */ /* win9x */
ok(GetLastError() == CRYPT_E_NOT_FOUND, ok(GetLastError() == CRYPT_E_NOT_FOUND ||
GetLastError() == OSS_DATA_ERROR /* some win98 */,
"Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError()); "Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError());
} }
else else
...@@ -389,10 +391,14 @@ static void testAddCTLToStore(void) ...@@ -389,10 +391,14 @@ static void testAddCTLToStore(void)
signedCTLWithCTLInnerContent, sizeof(signedCTLWithCTLInnerContent), signedCTLWithCTLInnerContent, sizeof(signedCTLWithCTLInnerContent),
CERT_STORE_ADD_NEW, NULL); CERT_STORE_ADD_NEW, NULL);
ok(ret, "CertAddEncodedCTLToStore failed: %08x\n", GetLastError()); ok(ret, "CertAddEncodedCTLToStore failed: %08x\n", GetLastError());
expectedCTLs = 1;
ret = CertAddEncodedCTLToStore(store, X509_ASN_ENCODING, ret = CertAddEncodedCTLToStore(store, X509_ASN_ENCODING,
signedCTLWithUsage, sizeof(signedCTLWithUsage), CERT_STORE_ADD_NEW, signedCTLWithUsage, sizeof(signedCTLWithUsage), CERT_STORE_ADD_NEW,
NULL); NULL);
ok(ret, "CertAddEncodedCTLToStore failed: %08x\n", GetLastError()); ok(ret || broken(GetLastError() == OSS_DATA_ERROR /* some win98 */),
"CertAddEncodedCTLToStore failed: %08x\n", GetLastError());
if (ret)
expectedCTLs++;
/* Check that two exist */ /* Check that two exist */
numCTLs = 0; numCTLs = 0;
ctl = NULL; ctl = NULL;
...@@ -401,8 +407,8 @@ static void testAddCTLToStore(void) ...@@ -401,8 +407,8 @@ static void testAddCTLToStore(void)
if (ctl) if (ctl)
numCTLs++; numCTLs++;
} while (ctl); } while (ctl);
ok(numCTLs == 2 || broken(numCTLs == 1 /* some Win98 */), ok(numCTLs == expectedCTLs, "expected %d CTLs, got %d\n", expectedCTLs,
"expected 2 CTLs, got %d\n", numCTLs); numCTLs);
CertCloseStore(store, 0); CertCloseStore(store, 0);
store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
......
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