Juan Lang : crypt32: Fix some test failures on Windows 98.

Alexandre Julliard julliard at winehq.org
Fri Feb 13 08:59:17 CST 2009


Module: wine
Branch: master
Commit: 11faf8a53a2c53c3979a2f3b8f502d5fd0a41934
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=11faf8a53a2c53c3979a2f3b8f502d5fd0a41934

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Feb 12 16:14:38 2009 -0800

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.

---

 dlls/crypt32/tests/cert.c |   40 ++++++++++++++++++++++++++++++----------
 1 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c
index a22ec7c..ffb9105 100644
--- a/dlls/crypt32/tests/cert.c
+++ b/dlls/crypt32/tests/cert.c
@@ -181,10 +181,15 @@ static void testAddCert(void)
     context = NULL;
     ret = CertAddEncodedCertificateToStore(0, X509_ASN_ENCODING, bigCert,
      sizeof(bigCert), CERT_STORE_ADD_ALWAYS, &context);
-    ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
-     GetLastError());
+    ok(ret || broken(GetLastError() == OSS_DATA_ERROR /* win98 */),
+     "CertAddEncodedCertificateToStore failed: %08x\n", GetLastError());
     if (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,
      bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, NULL);
@@ -409,8 +414,8 @@ static void testCertProperties(void)
     CRYPT_DATA_BLOB blob;
     CERT_KEY_CONTEXT keyContext;
 
-    ok(context != NULL, "CertCreateCertificateContext failed: %08x\n",
-     GetLastError());
+    ok(context != NULL || broken(GetLastError() == OSS_DATA_ERROR /* win98 */),
+     "CertCreateCertificateContext failed: %08x\n", GetLastError());
     if (!context)
         return;
 
@@ -641,8 +646,13 @@ static void testDupCert(void)
 
     ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
      bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, &context);
-    ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
-     GetLastError());
+    ok(ret || broken(GetLastError() == OSS_DATA_ERROR /* win98 */),
+     "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");
     if (context)
     {
@@ -1014,8 +1024,13 @@ static void testFindCert(void)
 
     ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
      bigCert, sizeof(bigCert), CERT_STORE_ADD_NEW, NULL);
-    ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
-     GetLastError());
+    ok(ret || broken(GetLastError() == OSS_DATA_ERROR /* win98 */),
+     "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,
      bigCert2, sizeof(bigCert2), CERT_STORE_ADD_NEW, NULL);
     ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
@@ -1199,8 +1214,13 @@ static void testGetSubjectCert(void)
 
     ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
      bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, NULL);
-    ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
-     GetLastError());
+    ok(ret || broken(GetLastError() == OSS_DATA_ERROR /* win98 */),
+     "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,
      bigCert2, sizeof(bigCert2), CERT_STORE_ADD_NEW, &context1);
     ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",




More information about the wine-cvs mailing list