Commit 11faf8a5 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Fix some test failures on Windows 98.

This is as much an experiment as anything. The tests currently time out, so I'm curious whether fixing some other failures will result in the timeout going away, or at least moving elsewhere.
parent d1dc7e5b
...@@ -181,10 +181,15 @@ static void testAddCert(void) ...@@ -181,10 +181,15 @@ static void testAddCert(void)
context = NULL; context = NULL;
ret = CertAddEncodedCertificateToStore(0, X509_ASN_ENCODING, bigCert, ret = CertAddEncodedCertificateToStore(0, X509_ASN_ENCODING, bigCert,
sizeof(bigCert), CERT_STORE_ADD_ALWAYS, &context); sizeof(bigCert), CERT_STORE_ADD_ALWAYS, &context);
ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", ok(ret || broken(GetLastError() == OSS_DATA_ERROR /* win98 */),
GetLastError()); "CertAddEncodedCertificateToStore failed: %08x\n", GetLastError());
if (context) if (context)
CertFreeCertificateContext(context); CertFreeCertificateContext(context);
if (!ret && GetLastError() == OSS_DATA_ERROR)
{
skip("bigCert can't be decoded, skipping tests\n");
return;
}
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, NULL); bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, NULL);
...@@ -409,8 +414,8 @@ static void testCertProperties(void) ...@@ -409,8 +414,8 @@ static void testCertProperties(void)
CRYPT_DATA_BLOB blob; CRYPT_DATA_BLOB blob;
CERT_KEY_CONTEXT keyContext; CERT_KEY_CONTEXT keyContext;
ok(context != NULL, "CertCreateCertificateContext failed: %08x\n", ok(context != NULL || broken(GetLastError() == OSS_DATA_ERROR /* win98 */),
GetLastError()); "CertCreateCertificateContext failed: %08x\n", GetLastError());
if (!context) if (!context)
return; return;
...@@ -641,8 +646,13 @@ static void testDupCert(void) ...@@ -641,8 +646,13 @@ static void testDupCert(void)
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, &context); bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, &context);
ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", ok(ret || broken(GetLastError() == OSS_DATA_ERROR /* win98 */),
GetLastError()); "CertAddEncodedCertificateToStore failed: %08x\n", GetLastError());
if (!ret && GetLastError() == OSS_DATA_ERROR)
{
skip("bigCert can't be decoded, skipping tests\n");
return;
}
ok(context != NULL, "Expected a valid cert context\n"); ok(context != NULL, "Expected a valid cert context\n");
if (context) if (context)
{ {
...@@ -1014,8 +1024,13 @@ static void testFindCert(void) ...@@ -1014,8 +1024,13 @@ static void testFindCert(void)
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
bigCert, sizeof(bigCert), CERT_STORE_ADD_NEW, NULL); bigCert, sizeof(bigCert), CERT_STORE_ADD_NEW, NULL);
ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", ok(ret || broken(GetLastError() == OSS_DATA_ERROR /* win98 */),
GetLastError()); "CertAddEncodedCertificateToStore failed: %08x\n", GetLastError());
if (!ret && GetLastError() == OSS_DATA_ERROR)
{
skip("bigCert can't be decoded, skipping tests\n");
return;
}
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
bigCert2, sizeof(bigCert2), CERT_STORE_ADD_NEW, NULL); bigCert2, sizeof(bigCert2), CERT_STORE_ADD_NEW, NULL);
ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
...@@ -1199,8 +1214,13 @@ static void testGetSubjectCert(void) ...@@ -1199,8 +1214,13 @@ static void testGetSubjectCert(void)
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, NULL); bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, NULL);
ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", ok(ret || broken(GetLastError() == OSS_DATA_ERROR /* win98 */),
GetLastError()); "CertAddEncodedCertificateToStore failed: %08x\n", GetLastError());
if (!ret && GetLastError() == OSS_DATA_ERROR)
{
skip("bigCert can't be decoded, skipping tests\n");
return;
}
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
bigCert2, sizeof(bigCert2), CERT_STORE_ADD_NEW, &context1); bigCert2, sizeof(bigCert2), CERT_STORE_ADD_NEW, &context1);
ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
......
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