Juan Lang : crypt32: Test CryptMsgOpenToEncode for data messages.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jun 29 08:14:37 CDT 2007


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Jun 28 16:46:08 2007 -0700

crypt32: Test CryptMsgOpenToEncode for data messages.

---

 dlls/crypt32/tests/msg.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c
index 035a40c..8bebdb9 100644
--- a/dlls/crypt32/tests/msg.c
+++ b/dlls/crypt32/tests/msg.c
@@ -281,6 +281,30 @@ static void test_msg_close(void)
     ok(ret, "CryptMsgClose failed: %x\n", GetLastError());
 }
 
+static void test_data_msg_open(void)
+{
+    HCRYPTMSG msg;
+    CMSG_HASHED_ENCODE_INFO hashInfo = { 0 };
+
+    /* The data message type takes no additional info */
+    SetLastError(0xdeadbeef);
+    msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, &hashInfo,
+     NULL, NULL);
+    todo_wine {
+    ok(!msg && GetLastError() == E_INVALIDARG,
+     "Expected E_INVALIDARG, got %x\n", GetLastError());
+    msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, NULL, NULL,
+     NULL);
+    ok(msg != NULL, "CryptMsgOpenToEncode failed: %x\n", GetLastError());
+    }
+    CryptMsgClose(msg);
+}
+
+static void test_data_msg(void)
+{
+    test_data_msg_open();
+}
+
 START_TEST(msg)
 {
     /* Basic parameter checking tests */
@@ -288,4 +312,7 @@ START_TEST(msg)
     test_msg_open_to_decode();
     test_msg_get_param();
     test_msg_close();
+
+    /* Message-type specific tests */
+    test_data_msg();
 }




More information about the wine-cvs mailing list