Juan Lang : crypt32: Fix tests on older Windows versions.
Alexandre Julliard
julliard at winehq.org
Fri Nov 20 10:48:00 CST 2009
Module: wine
Branch: master
Commit: bcbfddd82ac0efb278d2ea0590f697a3561bebcb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bcbfddd82ac0efb278d2ea0590f697a3561bebcb
Author: Juan Lang <juan.lang at gmail.com>
Date: Thu Nov 19 10:46:29 2009 -0800
crypt32: Fix tests on older Windows versions.
---
dlls/crypt32/tests/crl.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/dlls/crypt32/tests/crl.c b/dlls/crypt32/tests/crl.c
index b012db1..bd70d32 100644
--- a/dlls/crypt32/tests/crl.c
+++ b/dlls/crypt32/tests/crl.c
@@ -466,7 +466,7 @@ static void testFindCRL(void)
/* Try various find flags */
context = pCertFindCRLInStore(store, 0, CRL_FIND_ISSUED_BY_SIGNATURE_FLAG,
CRL_FIND_ISSUED_BY, cert, NULL);
- ok(!context, "unexpected context\n");
+ ok(!context || broken(context != NULL /* Win9x */), "unexpected context\n");
/* The CRL doesn't have an AKI extension, so it matches any cert */
context = pCertFindCRLInStore(store, 0, CRL_FIND_ISSUED_BY_AKI_FLAG,
CRL_FIND_ISSUED_BY, cert, NULL);
@@ -487,7 +487,8 @@ static void testFindCRL(void)
issuedForPara.pIssuerCert = cert;
context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR,
&issuedForPara, NULL);
- ok(context != NULL, "Expected a context\n");
+ ok(context != NULL || broken(!context /* Win9x, NT4 */),
+ "Expected a context\n");
if (context)
{
ok(context->cbCrlEncoded == sizeof(signedCRL),
@@ -529,12 +530,13 @@ static void testFindCRL(void)
* match cert's issuer, but verisignCRL does not, so the expected count
* is 0.
*/
- ok(count == 3, "expected 3 matching CRLs, got %d\n", count);
+ ok(count == 3 || broken(count == 0 /* NT4, Win9x */),
+ "expected 3 matching CRLs, got %d\n", count);
/* Only v1CRLWithIssuerAndEntry and v2CRLWithIssuingDistPoint contain
* entries, so the count of CRL entries that match cert is 2.
*/
- ok(revoked_count == 2, "expected 2 matching CRL entries, got %d\n",
- revoked_count);
+ ok(revoked_count == 2 || broken(revoked_count == 0 /* NT4, Win9x */),
+ "expected 2 matching CRL entries, got %d\n", revoked_count);
CertFreeCertificateContext(cert);
@@ -589,7 +591,8 @@ static void testFindCRL(void)
revoked_count++;
}
} while (context);
- ok(count == 1, "expected 1 matching CRLs, got %d\n", count);
+ ok(count == 1 || broken(count == 0 /* Win9x, NT4 */),
+ "expected 1 matching CRLs, got %d\n", count);
ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n",
revoked_count);
CertFreeCertificateContext(cert);
@@ -628,9 +631,10 @@ static void testFindCRL(void)
revoked_count++;
}
} while (context);
- ok(count == 1, "expected 1 matching CRLs, got %d\n", count);
- ok(revoked_count == 1, "expected 1 matching CRL entries, got %d\n",
- revoked_count);
+ ok(count == 1 || broken(count == 0 /* Win9x, NT4 */),
+ "expected 1 matching CRLs, got %d\n", count);
+ ok(revoked_count == 1 || broken(revoked_count == 0 /* Win9x, NT4 */),
+ "expected 1 matching CRL entries, got %d\n", revoked_count);
/* Test CRL_FIND_ISSUED_BY flags */
count = revoked_count = 0;
@@ -701,7 +705,8 @@ static void testFindCRL(void)
}
} while (context);
todo_wine
- ok(count == 0, "expected 0 matching CRLs, got %d\n", count);
+ ok(count == 0 || broken(count == 1 /* Win9x */),
+ "expected 1 matching CRLs, got %d\n", count);
ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n",
revoked_count);
count = revoked_count = 0;
More information about the wine-cvs
mailing list