rpcrt4: Unify the formatting around todo_wine.
Gerald Pfeifer
gerald at pfeifer.com
Mon Jun 22 15:42:31 CDT 2015
When looking into something else, I noticed how this was used
totally inconsistently (and confusingly).
With this patch we follow the prevalent style across the board,
and especially the most confusing
todo_wine
ok(...)
is gone.
If you prefer a different standard formatting, please advise.
Gerald
---
dlls/rpcrt4/tests/ndr_marshall.c | 65 ++++++++++++++++++++++++----------------
1 file changed, 39 insertions(+), 26 deletions(-)
diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c
index 411ba8b..c1954bb 100644
--- a/dlls/rpcrt4/tests/ndr_marshall.c
+++ b/dlls/rpcrt4/tests/ndr_marshall.c
@@ -282,7 +282,7 @@ static void test_pointer_marshal(const unsigned char *formattypes,
/* doesn't allocate mem in this case */
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 %d\n", msgpfx, StubMsg.Buffer, StubMsg.BufferStart, wiredatalen);
ok(StubMsg.MemorySize == 0, "%s: memorysize %d\n", msgpfx, StubMsg.MemorySize);
@@ -611,10 +611,10 @@ static void test_nontrivial_pointer_types(void)
my_alloc_called = 0;
StubMsg.Buffer = StubMsg.BufferStart;
NdrPointerUnmarshall( &StubMsg, &mem, &fmtstr_ref_unique_out[4], 1);
- todo_wine {
- ok(mem == mem_orig, "mem alloced\n");
- ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
- }
+todo_wine {
+ ok(mem == mem_orig, "mem alloced\n");
+ ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
+}
my_free_called = 0;
StubMsg.Buffer = StubMsg.BufferStart;
@@ -644,8 +644,9 @@ static void test_nontrivial_pointer_types(void)
StubMsg.Buffer = StubMsg.BufferStart;
NdrPointerUnmarshall( &StubMsg, &mem, &fmtstr_ref_unique_out[4], 0);
ok(mem != StubMsg.BufferStart, "mem pointing at buffer\n");
- todo_wine
+todo_wine {
ok(my_alloc_called == 1, "alloc called %d\n", my_alloc_called);
+}
NdrPointerFree( &StubMsg, mem, &fmtstr_ref_unique_out[4] );
my_alloc_called = 0;
@@ -653,8 +654,9 @@ static void test_nontrivial_pointer_types(void)
StubMsg.Buffer = StubMsg.BufferStart;
NdrPointerUnmarshall( &StubMsg, &mem, &fmtstr_ref_unique_out[4], 1);
ok(mem != StubMsg.BufferStart, "mem pointing at buffer\n");
- todo_wine
+todo_wine {
ok(my_alloc_called == 1, "alloc called %d\n", my_alloc_called);
+}
NdrPointerFree( &StubMsg, mem, &fmtstr_ref_unique_out[4] );
my_alloc_called = 0;
@@ -662,20 +664,20 @@ static void test_nontrivial_pointer_types(void)
*(void **)mem = NULL;
StubMsg.Buffer = StubMsg.BufferStart;
NdrPointerUnmarshall( &StubMsg, &mem, &fmtstr_ref_unique_out[4], 0);
- todo_wine {
- ok(mem == mem_orig, "mem alloced\n");
- ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
- }
+todo_wine {
+ ok(mem == mem_orig, "mem alloced\n");
+ ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
+}
my_alloc_called = 0;
mem = mem_orig;
*(void **)mem = NULL;
StubMsg.Buffer = StubMsg.BufferStart;
NdrPointerUnmarshall( &StubMsg, &mem, &fmtstr_ref_unique_out[4], 1);
- todo_wine {
- ok(mem == mem_orig, "mem alloced\n");
- ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
- }
+todo_wine {
+ ok(mem == mem_orig, "mem alloced\n");
+ ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
+}
mem = my_alloc(sizeof(void *));
*(void **)mem = NULL;
@@ -1314,8 +1316,9 @@ static void test_server_init(void)
ok(stubMsg.Buffer == buffer, "stubMsg.Buffer should have been %p instead of %p\n", buffer, stubMsg.Buffer);
ok(stubMsg.BufferStart == buffer, "stubMsg.BufferStart should have been %p instead of %p\n", buffer, stubMsg.BufferStart);
ok(stubMsg.BufferEnd == buffer + sizeof(buffer), "stubMsg.BufferEnd should have been %p instead of %p\n", buffer + sizeof(buffer), stubMsg.BufferEnd);
-todo_wine
+todo_wine {
ok(stubMsg.BufferLength == 0, "stubMsg.BufferLength should have been 0 instead of %u\n", stubMsg.BufferLength);
+}
ok(stubMsg.IsClient == 0, "stubMsg.IsClient should have been 0 instead of %u\n", stubMsg.IsClient);
ok(stubMsg.ReuseBuffer == 0 ||
broken(stubMsg.ReuseBuffer == 1), /* win2k */
@@ -1683,10 +1686,12 @@ static void test_nonconformant_string(void)
my_alloc_called = 0;
StubMsg.Buffer = StubMsg.BufferStart;
NdrNonConformantStringUnmarshall( &StubMsg, &mem, fmtstr_nonconf_str, 1);
- todo_wine
+todo_wine {
ok(mem == mem_orig, "mem alloced\n");
- todo_wine
+}
+todo_wine {
ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
+}
/* Server */
my_alloc_called = 0;
@@ -1710,10 +1715,12 @@ static void test_nonconformant_string(void)
mem = mem_orig;
StubMsg.Buffer = StubMsg.BufferStart;
NdrNonConformantStringUnmarshall( &StubMsg, &mem, fmtstr_nonconf_str, 1);
- todo_wine
+todo_wine {
ok(mem == mem_orig, "mem alloced\n");
- todo_wine
+}
+todo_wine {
ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
+}
HeapFree(GetProcessHeap(), 0, mem_orig);
HeapFree(GetProcessHeap(), 0, StubMsg.RpcMsg->Buffer);
@@ -1756,10 +1763,12 @@ static void test_nonconformant_string(void)
my_alloc_called = 0;
StubMsg.Buffer = StubMsg.BufferStart;
NdrNonConformantStringUnmarshall( &StubMsg, &mem, fmtstr_nonconf_str, 1);
- todo_wine
+todo_wine {
ok(mem == mem_orig, "mem alloced\n");
- todo_wine
+}
+todo_wine {
ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
+}
/* Server */
my_alloc_called = 0;
@@ -1783,10 +1792,12 @@ static void test_nonconformant_string(void)
mem = mem_orig;
StubMsg.Buffer = StubMsg.BufferStart;
NdrNonConformantStringUnmarshall( &StubMsg, &mem, fmtstr_nonconf_str, 1);
- todo_wine
+todo_wine {
ok(mem == mem_orig, "mem alloced\n");
- todo_wine
+}
+todo_wine {
ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
+}
HeapFree(GetProcessHeap(), 0, mem_orig);
HeapFree(GetProcessHeap(), 0, StubMsg.RpcMsg->Buffer);
@@ -2130,8 +2141,9 @@ static void test_ndr_buffer(void)
ok(StubMsg.Buffer != NULL, "Buffer should not have been NULL\n");
ok(!StubMsg.BufferStart, "BufferStart should have been NULL instead of %p\n", StubMsg.BufferStart);
ok(!StubMsg.BufferEnd, "BufferEnd should have been NULL instead of %p\n", StubMsg.BufferEnd);
-todo_wine
+todo_wine {
ok(StubMsg.BufferLength == 0, "BufferLength should have left as 0 instead of being set to %d\n", StubMsg.BufferLength);
+}
old_buffer_valid_location = !StubMsg.fBufferValid;
if (old_buffer_valid_location)
ok(broken(StubMsg.CorrDespIncrement == TRUE), "fBufferValid should have been TRUE instead of 0x%x\n", StubMsg.CorrDespIncrement);
@@ -2431,8 +2443,9 @@ static void test_MesEncodeFixedBufferHandleCreate(void)
ok(status == RPC_S_INVALID_ARG, "got %d\n", status);
status = MesEncodeFixedBufferHandleCreate(buffer, 0, &encoded_size, &handle);
-todo_wine
+todo_wine {
ok(status == RPC_S_INVALID_ARG, "got %d\n", status);
+}
if (status == RPC_S_OK)
MesHandleFree(handle);
--
2.4.2
More information about the wine-patches
mailing list