Rob Shearman : rpcrt4: Add tests for the RPC_MESSAGE members set by NdrClientInitializeNew.

Alexandre Julliard julliard at winehq.org
Mon Jan 7 16:25:00 CST 2008


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Mon Jan  7 15:19:49 2008 +0000

rpcrt4: Add tests for the RPC_MESSAGE members set by NdrClientInitializeNew.

---

 dlls/rpcrt4/tests/ndr_marshall.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c
index d02135b..eebed49 100644
--- a/dlls/rpcrt4/tests/ndr_marshall.c
+++ b/dlls/rpcrt4/tests/ndr_marshall.c
@@ -891,11 +891,28 @@ static void test_client_init(void)
     MIDL_STUB_MESSAGE stubMsg;
     RPC_MESSAGE rpcMsg;
 
-    memset(&rpcMsg, 0, sizeof(rpcMsg));
+    memset(&rpcMsg, 0xcc, sizeof(rpcMsg));
     memset(&stubMsg, 0xcc, sizeof(stubMsg));
 
     NdrClientInitializeNew(&rpcMsg, &stubMsg, &Object_StubDesc, 1);
 
+#define TEST_POINTER_UNSET(field) ok(rpcMsg.field == (void *)0xcccccccc, #field " should have been unset instead of %p\n", rpcMsg.field)
+
+    ok(rpcMsg.Handle == NULL, "rpcMsg.Handle should have been NULL instead of %p\n", rpcMsg.Handle);
+    TEST_POINTER_UNSET(Buffer);
+    ok(rpcMsg.BufferLength == 0xcccccccc, "rpcMsg.BufferLength should have been unset instead of %d\n", rpcMsg.BufferLength);
+    todo_wine
+    ok(rpcMsg.ProcNum == 0x8001, "rpcMsg.ProcNum should have been 0x8001 instead of 0x%x\n", rpcMsg.ProcNum);
+    TEST_POINTER_UNSET(TransferSyntax);
+    ok(rpcMsg.RpcInterfaceInformation == Object_StubDesc.RpcInterfaceInformation,
+        "rpcMsg.RpcInterfaceInformation should have been %p instead of %p\n",
+        Object_StubDesc.RpcInterfaceInformation, rpcMsg.RpcInterfaceInformation);
+    /* Note: ReservedForRuntime not tested */
+    TEST_POINTER_UNSET(ManagerEpv);
+    TEST_POINTER_UNSET(ImportContext);
+    ok(rpcMsg.RpcFlags == 0, "rpcMsg.RpcFlags should have been 0 instead of 0x%lx\n", rpcMsg.RpcFlags);
+#undef TEST_POINTER_UNSET
+
 #define TEST_ZERO(field, fmt) ok(stubMsg.field == 0, #field " should have been set to zero instead of " fmt "\n", stubMsg.field)
 #define TEST_POINTER_UNSET(field) ok(stubMsg.field == (void *)0xcccccccc, #field " should have been unset instead of %p\n", stubMsg.field)
 #define TEST_ULONG_UNSET(field) ok(stubMsg.field == 0xcccccccc, #field " should have been unset instead of 0x%x\n", stubMsg.field)




More information about the wine-cvs mailing list