Juan Lang : wintrust: Add tests for WVTAsn1SpcFinancialCriteriaInfoDecode.
Alexandre Julliard
julliard at winehq.org
Tue Nov 4 07:29:03 CST 2008
Module: wine
Branch: master
Commit: 4c88340f72d738de023864211526d693b4161fdb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4c88340f72d738de023864211526d693b4161fdb
Author: Juan Lang <juan.lang at gmail.com>
Date: Mon Nov 3 15:04:57 2008 -0800
wintrust: Add tests for WVTAsn1SpcFinancialCriteriaInfoDecode.
---
dlls/wintrust/tests/asn.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/dlls/wintrust/tests/asn.c b/dlls/wintrust/tests/asn.c
index 288c4d7..bbba1f4 100644
--- a/dlls/wintrust/tests/asn.c
+++ b/dlls/wintrust/tests/asn.c
@@ -65,6 +65,38 @@ static void test_encodeSPCFinancialCriteria(void)
}
}
+static void test_decodeSPCFinancialCriteria(void)
+{
+ BOOL ret;
+ SPC_FINANCIAL_CRITERIA criteria;
+ DWORD size = sizeof(criteria);
+
+ if (!pCryptDecodeObjectEx)
+ {
+ skip("CryptDecodeObjectEx() is not available. Skipping the decodeSPCFinancialCriteria tests\n");
+ return;
+ }
+
+ ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_FINANCIAL_CRITERIA_STRUCT,
+ falseCriteria, sizeof(falseCriteria), 0, NULL, &criteria, &size);
+ todo_wine
+ ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ if (ret)
+ {
+ ok(!criteria.fFinancialInfoAvailable, "expected FALSE\n");
+ ok(!criteria.fMeetsCriteria, "expected FALSE\n");
+ }
+ ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_FINANCIAL_CRITERIA_STRUCT,
+ trueCriteria, sizeof(trueCriteria), 0, NULL, &criteria, &size);
+ todo_wine
+ ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ if (ret)
+ {
+ ok(criteria.fFinancialInfoAvailable, "expected TRUE\n");
+ ok(criteria.fMeetsCriteria, "expected TRUE\n");
+ }
+}
+
static WCHAR url[] = { 'h','t','t','p',':','/','/','w','i','n','e','h','q','.',
'o','r','g',0 };
static const WCHAR nihongoURL[] = { 'h','t','t','p',':','/','/',0x226f,
@@ -763,6 +795,7 @@ START_TEST(asn)
pCryptEncodeObjectEx = (void*)GetProcAddress(hCrypt32, "CryptEncodeObjectEx");
test_encodeSPCFinancialCriteria();
+ test_decodeSPCFinancialCriteria();
test_encodeSPCLink();
test_decodeSPCLink();
test_encodeSPCPEImage();
More information about the wine-cvs
mailing list