rpcrt4/tests: Fix signed/unsigned and 32/64bit issues with the wiredatalen parameter.

This commit is contained in:
Francois Gouget 2007-05-28 01:11:20 +02:00 committed by Alexandre Julliard
parent 2e21d090cb
commit f27a7153a5
1 changed files with 10 additions and 10 deletions

View File

@ -113,7 +113,7 @@ static void test_pointer_marshal(const unsigned char *formattypes,
void *memsrc,
long srcsize,
const void *wiredata,
long wiredatalen,
ULONG wiredatalen,
int(*cmp)(const void*,const void*,size_t),
long num_additional_allocs,
const char *msgpfx)
@ -152,7 +152,7 @@ static void test_pointer_marshal(const unsigned char *formattypes,
ptr = NdrPointerMarshall( &StubMsg, memsrc, formattypes );
ok(ptr == NULL, "%s: ret %p\n", msgpfx, ptr);
ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %ld\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %d\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
ok(!memcmp(StubMsg.BufferStart, wiredata, wiredatalen), "%s: incorrectly marshaled\n", msgpfx);
StubMsg.Buffer = StubMsg.BufferStart;
@ -163,7 +163,7 @@ static void test_pointer_marshal(const unsigned char *formattypes,
/* NdrPointerMemorySize crashes under Wine */
size = NdrPointerMemorySize( &StubMsg, formattypes );
ok(size == StubMsg.MemorySize, "%s: mem size %u size %u\n", msgpfx, StubMsg.MemorySize, size);
ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %ld\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %d\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
if(formattypes[1] & 0x10 /* FC_POINTER_DEREF */)
ok(size == srcsize + 4, "%s: mem size %u\n", msgpfx, size);
else
@ -173,7 +173,7 @@ static void test_pointer_marshal(const unsigned char *formattypes,
StubMsg.MemorySize = 16;
size = NdrPointerMemorySize( &StubMsg, formattypes );
ok(size == StubMsg.MemorySize, "%s: mem size %u size %u\n", msgpfx, StubMsg.MemorySize, size);
ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %ld\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %d\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
if(formattypes[1] & 0x10 /* FC_POINTER_DEREF */)
ok(size == srcsize + 4 + 16, "%s: mem size %u\n", msgpfx, size);
else
@ -183,7 +183,7 @@ static void test_pointer_marshal(const unsigned char *formattypes,
StubMsg.MemorySize = 1;
size = NdrPointerMemorySize( &StubMsg, formattypes );
ok(size == StubMsg.MemorySize, "%s: mem size %u size %u\n", msgpfx, StubMsg.MemorySize, size);
ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %ld\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %d\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
if(formattypes[1] & 0x10 /* FC_POINTER_DEREF */)
ok(size == srcsize + 4 + (srcsize == 8 ? 8 : 4), "%s: mem size %u\n", msgpfx, size);
else
@ -203,7 +203,7 @@ static void test_pointer_marshal(const unsigned char *formattypes,
ok(ptr == NULL, "%s: ret %p\n", msgpfx, ptr);
ok(mem == mem_orig, "%s: mem has changed %p %p\n", msgpfx, mem, mem_orig);
ok(!cmp(mem, memsrc, srcsize), "%s: incorrectly unmarshaled\n", msgpfx);
ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %ld\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
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);
ok(my_alloc_called == num_additional_allocs, "%s: my_alloc got called %d times\n", msgpfx, my_alloc_called);
my_alloc_called = 0;
@ -219,7 +219,7 @@ todo_wine {
ok(mem == mem_orig, "%s: mem has changed %p %p\n", msgpfx, mem, mem_orig);
}
ok(!cmp(mem, memsrc, srcsize), "%s: incorrectly unmarshaled\n", msgpfx);
ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %ld\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
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);
todo_wine {
@ -235,7 +235,7 @@ todo_wine {
ok(ptr == NULL, "%s: ret %p\n", msgpfx, ptr);
ok(mem != StubMsg.BufferStart + wiredatalen - srcsize, "%s: mem points to buffer %p %p\n", msgpfx, mem, StubMsg.BufferStart);
ok(!cmp(mem, memsrc, size), "%s: incorrectly unmarshaled\n", msgpfx);
ok(StubMsg.Buffer - StubMsg.BufferStart == wiredatalen, "%s: Buffer %p Start %p len %ld\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
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);
ok(my_alloc_called == num_additional_allocs + 1, "%s: my_alloc got called %d times\n", msgpfx, my_alloc_called);
my_alloc_called = 0;
@ -251,7 +251,7 @@ todo_wine {
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 %ld\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
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);
todo_wine {
ok(my_alloc_called == num_additional_allocs, "%s: my_alloc got called %d times\n", msgpfx, my_alloc_called);
@ -454,7 +454,7 @@ static void test_simple_struct_marshal(const unsigned char *formattypes,
void *memsrc,
long srcsize,
const void *wiredata,
long wiredatalen,
ULONG wiredatalen,
int(*cmp)(const void*,const void*,size_t),
long num_additional_allocs,
const char *msgpfx)