Module: wine Branch: master Commit: 41713097314354fb37df2cb71d78624d9e08a0df URL: http://source.winehq.org/git/wine.git/?a=commit;h=41713097314354fb37df2cb71d...
Author: Rob Shearman rob@codeweavers.com Date: Tue Nov 27 12:32:48 2007 +0000
rpcrt4: Fix the tests for up_enum16.
It is different to the other base types as it has a different size on the wire to in memory, so it can't just be set to the buffer when unmarshalling.
---
dlls/rpcrt4/tests/ndr_marshall.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c index f64c766..06b7b51 100644 --- a/dlls/rpcrt4/tests/ndr_marshall.c +++ b/dlls/rpcrt4/tests/ndr_marshall.c @@ -247,16 +247,21 @@ todo_wine { StubMsg.IsClient = 0; ptr = NdrPointerUnmarshall( &StubMsg, &mem, formattypes, 0 ); ok(ptr == NULL, "%s: ret %p\n", msgpfx, ptr); + if (formattypes[2] == 0xd /* FC_ENUM16 */) + ok(mem != StubMsg.BufferStart + wiredatalen - srcsize, "%s: mem points to buffer %p %p\n", msgpfx, mem, StubMsg.BufferStart); + else todo_wine { - ok(mem == StubMsg.BufferStart + wiredatalen - srcsize, "%s: mem doesn't point to buffer %p %p\n", msgpfx, mem, StubMsg.BufferStart); + ok(mem == StubMsg.BufferStart + wiredatalen - srcsize, "%s: mem doesn't point to buffer %p %p\n", msgpfx, mem, StubMsg.BufferStart); } ok(!cmp(mem, memsrc, size), "%s: incorrecly unmarshaled\n", msgpfx); ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %d\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen); ok(StubMsg.MemorySize == 0, "%s: memorysize %d\n", msgpfx, StubMsg.MemorySize); + if (formattypes[2] != 0xd /* FC_ENUM16 */) { todo_wine { - ok(my_alloc_called == num_additional_allocs, "%s: my_alloc got called %d times\n", msgpfx, my_alloc_called); - my_alloc_called = 0; + ok(my_alloc_called == num_additional_allocs, "%s: my_alloc got called %d times\n", msgpfx, my_alloc_called); + my_alloc_called = 0; } + } } HeapFree(GetProcessHeap(), 0, mem_orig); HeapFree(GetProcessHeap(), 0, StubMsg.BufferStart);