Maarten Lankhorst : rpcrt4: Fix ndr_marshall test failures.
Alexandre Julliard
julliard at winehq.org
Wed May 7 13:28:14 CDT 2008
Module: wine
Branch: master
Commit: fd7b277d8ac23706b1c819d2ed1fd0ee9833fd06
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fd7b277d8ac23706b1c819d2ed1fd0ee9833fd06
Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Tue May 6 15:06:17 2008 -0700
rpcrt4: Fix ndr_marshall test failures.
Created with help from Robert Shearman.
---
dlls/rpcrt4/tests/ndr_marshall.c | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c
index 72fd1be..1ff5e3b 100644
--- a/dlls/rpcrt4/tests/ndr_marshall.c
+++ b/dlls/rpcrt4/tests/ndr_marshall.c
@@ -514,7 +514,9 @@ static void test_nontrivial_pointer_types(void)
NdrPointerBufferSize( &StubMsg,
(unsigned char *)p1,
&fmtstr_ref_unique_out[4] );
- ok(StubMsg.BufferLength == 5, "length %d\n", StubMsg.BufferLength);
+
+ /* Windows overestimates the buffer size */
+ ok(StubMsg.BufferLength >= 5, "length %d\n", StubMsg.BufferLength);
/*NdrGetBuffer(&_StubMsg, _StubMsg.BufferLength, NULL);*/
StubMsg.RpcMsg->Buffer = StubMsg.BufferStart = StubMsg.Buffer = HeapAlloc(GetProcessHeap(), 0, StubMsg.BufferLength);
@@ -1706,7 +1708,7 @@ static void test_nonconformant_string(void)
static void test_ndr_buffer(void)
{
static unsigned char ncalrpc[] = "ncalrpc";
- static unsigned char endpoint[] = "winetest:" __FILE__;
+ static unsigned char endpoint[] = "winetest:test_ndr_buffer";
RPC_MESSAGE RpcMessage;
MIDL_STUB_MESSAGE StubMsg;
MIDL_STUB_DESC StubDesc = Object_StubDesc;
@@ -1717,9 +1719,17 @@ static void test_ndr_buffer(void)
StubDesc.RpcInterfaceInformation = (void *)&IFoo___RpcServerInterface;
- ok(RPC_S_OK == RpcServerUseProtseqEp(ncalrpc, 20, endpoint, NULL), "RpcServerUseProtseqEp\n");
- ok(RPC_S_OK == RpcServerRegisterIf(IFoo_v0_0_s_ifspec, NULL, NULL), "RpcServerRegisterIf\n");
- ok(RPC_S_OK == RpcServerListen(1, 20, TRUE), "RpcServerListen\n");
+ status = RpcServerUseProtseqEp(ncalrpc, 20, endpoint, NULL);
+ ok(RPC_S_OK == status, "RpcServerUseProtseqEp failed with status %lu\n", status);
+ status = RpcServerRegisterIf(IFoo_v0_0_s_ifspec, NULL, NULL);
+ ok(RPC_S_OK == status, "RpcServerRegisterIf failed with status %lu\n", status);
+ status = RpcServerListen(1, 20, TRUE);
+ ok(RPC_S_OK == status, "RpcServerListen failed with status %lu\n", status);
+ if (status != RPC_S_OK)
+ {
+ /* Failed to create a server, running client tests is useless */
+ return;
+ }
status = RpcStringBindingCompose(NULL, ncalrpc, NULL, endpoint, NULL, &binding);
ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%lu)\n", status);
More information about the wine-cvs
mailing list