Commit b40a406d authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Tighten CertDuplicateCertificateContext test.

Test that the return from CertDuplicateCertificateContext is the same as its parameter.
parent 832dd3c7
...@@ -143,17 +143,11 @@ static void testDupCert(void) ...@@ -143,17 +143,11 @@ static void testDupCert(void)
dupContext = CertDuplicateCertificateContext(context); dupContext = CertDuplicateCertificateContext(context);
ok(dupContext != NULL, "Expected valid duplicate\n"); ok(dupContext != NULL, "Expected valid duplicate\n");
if (dupContext) /* Not only is it a duplicate, it's identical: the address is the
{ * same.
ok(dupContext->cbCertEncoded == sizeof(bigCert), */
"Expected cert of %d bytes, got %ld\n", sizeof(bigCert), ok(dupContext == context, "Expected identical context addresses\n");
dupContext->cbCertEncoded); CertFreeCertificateContext(dupContext);
ok(!memcmp(dupContext->pbCertEncoded, bigCert,
sizeof(bigCert)),
"Unexpected encoded cert in context\n");
ok(dupContext->hCertStore == store, "Unexpected store\n");
CertFreeCertificateContext(dupContext);
}
CertFreeCertificateContext(context); CertFreeCertificateContext(context);
} }
CertCloseStore(store, 0); CertCloseStore(store, 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