rpcrt4/tests: Use BOOL type where appropriate

Frédéric Delanoy frederic.delanoy at gmail.com
Fri Nov 29 18:50:08 CST 2013


---
 dlls/rpcrt4/tests/ndr_marshall.c | 57 ++++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 28 deletions(-)

diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c
index 1d8a64d..6826382 100644
--- a/dlls/rpcrt4/tests/ndr_marshall.c
+++ b/dlls/rpcrt4/tests/ndr_marshall.c
@@ -311,7 +311,7 @@ todo_wine {
         {
             mem = NULL;
             StubMsg.Buffer = StubMsg.BufferStart;
-            StubMsg.IsClient = 0;
+            StubMsg.IsClient = FALSE;
             ptr = NdrPointerUnmarshall( &StubMsg, &mem, formattypes, 0 );
             ok(ptr == NULL, "%s: ret %p\n", msgpfx, ptr);
             if (formattypes[2] == 0xd /* FC_ENUM16 */)
@@ -639,7 +639,7 @@ static void test_nontrivial_pointer_types(void)
 
     /* Server */
     my_alloc_called = 0;
-    StubMsg.IsClient = 0;
+    StubMsg.IsClient = FALSE;
     mem = NULL;
     StubMsg.Buffer = StubMsg.BufferStart;
     NdrPointerUnmarshall( &StubMsg, &mem, &fmtstr_ref_unique_out[4], 0);
@@ -760,7 +760,7 @@ static void test_simple_struct_marshal(const unsigned char *formattypes,
 
     /* If we're a server we still use the supplied memory */
     StubMsg.Buffer = StubMsg.BufferStart;
-    StubMsg.IsClient = 0;
+    StubMsg.IsClient = FALSE;
     ptr = NdrSimpleStructUnmarshall( &StubMsg, &mem, formattypes, 0 );
     ok(ptr == NULL, "%s: ret %p\n", msgpfx, ptr);
     ok(mem == mem_orig, "%s: mem has changed %p %p\n", msgpfx, mem, mem_orig);
@@ -776,7 +776,7 @@ static void test_simple_struct_marshal(const unsigned char *formattypes,
     if (0)  /* crashes on Win9x and NT4 */
     {
         mem = NULL;
-        StubMsg.IsClient = 0;
+        StubMsg.IsClient = FALSE;
         StubMsg.Buffer = StubMsg.BufferStart;
         ptr = NdrSimpleStructUnmarshall( &StubMsg, &mem, formattypes, FALSE );
         ok(ptr == NULL, "%s: ret %p\n", msgpfx, ptr);
@@ -792,7 +792,7 @@ static void test_simple_struct_marshal(const unsigned char *formattypes,
     /* with must_alloc set we always allocate new memory whether or not we're
        a server and also when passing NULL */
     mem = mem_orig;
-    StubMsg.IsClient = 1;
+    StubMsg.IsClient = TRUE;
     StubMsg.Buffer = StubMsg.BufferStart;
     ptr = NdrSimpleStructUnmarshall( &StubMsg, &mem, formattypes, 1 );
     ok(ptr == NULL, "ret %p\n", ptr);
@@ -814,7 +814,7 @@ static void test_simple_struct_marshal(const unsigned char *formattypes,
 
     mem = mem_orig;
     StubMsg.Buffer = StubMsg.BufferStart;
-    StubMsg.IsClient = 0;
+    StubMsg.IsClient = FALSE;
     StubMsg.ReuseBuffer = 1;
     ptr = NdrSimpleStructUnmarshall( &StubMsg, &mem, formattypes, 1 );
     ok(ptr == NULL, "ret %p\n", ptr);
@@ -827,7 +827,7 @@ static void test_simple_struct_marshal(const unsigned char *formattypes,
 
     mem = NULL;
     StubMsg.Buffer = StubMsg.BufferStart;
-    StubMsg.IsClient = 0;
+    StubMsg.IsClient = FALSE;
     StubMsg.ReuseBuffer = 1;
     ptr = NdrSimpleStructUnmarshall( &StubMsg, &mem, formattypes, 1 );
     ok(ptr == NULL, "ret %p\n", ptr);
@@ -1152,6 +1152,7 @@ static void test_common_stub_data( const char *prefix, const MIDL_STUB_MESSAGE *
     memset(&unset_ptr, 0xcc, sizeof(unset_ptr));
 
 #define TEST_ZERO(field, fmt) ok(stubMsg->field == 0, "%s: " #field " should have been set to zero instead of " fmt "\n", prefix, stubMsg->field)
+#define TEST_FALSE(field, fmt) ok(stubMsg->field == FALSE, "%s: " #field " should have been set to FALSE instead of " fmt "\n", prefix, stubMsg->field)
 #define TEST_POINTER_UNSET(field) ok(stubMsg->field == unset_ptr, "%s: " #field " should have been unset instead of %p\n", prefix, stubMsg->field)
 #define TEST_ULONG_UNSET(field) ok(stubMsg->field == 0xcccccccc, "%s: " #field " should have been unset instead of 0x%x\n", prefix, stubMsg->field)
 #define TEST_ULONG_PTR_UNSET(field) ok(stubMsg->field == (ULONG_PTR)unset_ptr, "%s: " #field " should have been unset instead of 0x%lx\n", prefix, stubMsg->field)
@@ -1164,7 +1165,7 @@ static void test_common_stub_data( const char *prefix, const MIDL_STUB_MESSAGE *
        broken(stubMsg->pPointerQueueState == unset_ptr), /* win2k */
        "%s: pPointerQueueState should have been unset instead of %p\n",
        prefix, stubMsg->pPointerQueueState);
-    TEST_ZERO(IgnoreEmbeddedPointers, "%d");
+    TEST_FALSE(IgnoreEmbeddedPointers, "%d");
     TEST_ZERO(PointerBufferMark, "%p");
     ok( stubMsg->uFlags == 0 ||
         broken(stubMsg->uFlags == 0xcc), /* win9x */
@@ -1187,18 +1188,18 @@ static void test_common_stub_data( const char *prefix, const MIDL_STUB_MESSAGE *
     ok( stubMsg->PointerLength == 0 ||
         broken(stubMsg->PointerLength == 1), /* win9x, nt4 */
         "%s: pAsyncMsg should have been set to zero instead of %d\n", prefix, stubMsg->PointerLength );
-    TEST_ZERO(fInDontFree, "%d");
-    TEST_ZERO(fDontCallFreeInst, "%d");
-    ok( stubMsg->fHasReturn == 0 || broken(stubMsg->fHasReturn), /* win9x, nt4 */
-        "%s: fHasReturn should have been set to zero instead of %d\n", prefix, stubMsg->fHasReturn );
-    TEST_ZERO(fHasExtensions, "%d");
-    TEST_ZERO(fHasNewCorrDesc, "%d");
-    ok(stubMsg->fIsIn == 0 || broken(stubMsg->fIsIn), /* win9x, nt4 */
-       "%s: fIsIn should have been set to 0 instead of %d\n", prefix, stubMsg->fIsIn);
-    TEST_ZERO(fIsOicf, "%d");
-    ok(stubMsg->fBufferValid == 0,
-       "%s: fBufferValid should have been set to 0 instead of %d\n", prefix, stubMsg->fBufferValid);
-    TEST_ZERO(fNeedMCCP, "%d");
+    TEST_FALSE(fInDontFree, "%u");
+    TEST_FALSE(fDontCallFreeInst, "%u");
+    ok( stubMsg->fHasReturn == FALSE || broken(stubMsg->fHasReturn), /* win9x, nt4 */
+        "%s: fHasReturn should have been set to FALSE instead of %u\n", prefix, stubMsg->fHasReturn );
+    TEST_FALSE(fHasExtensions, "%u");
+    TEST_FALSE(fHasNewCorrDesc, "%u");
+    ok(stubMsg->fIsIn == FALSE || broken(stubMsg->fIsIn), /* win9x, nt4 */
+       "%s: fIsIn should have been set to FALSE instead of %u\n", prefix, stubMsg->fIsIn);
+    TEST_FALSE(fIsOicf, "%u");
+    ok(stubMsg->fBufferValid == FALSE,
+       "%s: fBufferValid should have been set to FALSE instead of %u\n", prefix, stubMsg->fBufferValid);
+    TEST_FALSE(fNeedMCCP, "%u");
     ok(stubMsg->fUnused == 0 ||
        stubMsg->fUnused == -2, /* Vista */
        "%s: fUnused should have been set to 0 or -2 instead of %d\n", prefix, stubMsg->fUnused);
@@ -1282,7 +1283,7 @@ static void test_client_init(void)
        stubMsg.BufferEnd);
     ok(stubMsg.BufferLength == 0, "stubMsg.BufferLength should have been 0 instead of %u\n",
        stubMsg.BufferLength);
-    ok(stubMsg.IsClient == 1, "stubMsg.IsClient should have been 1 instead of %u\n", stubMsg.IsClient);
+    ok(stubMsg.IsClient == TRUE, "stubMsg.IsClient should have been TRUE instead of %u\n", stubMsg.IsClient);
     ok(stubMsg.ReuseBuffer == 0, "stubMsg.ReuseBuffer should have been 0 instead of %d\n",
        stubMsg.ReuseBuffer);
     ok(stubMsg.CorrDespIncrement == 0, "stubMsg.CorrDespIncrement should have been 0 instead of %d\n",
@@ -1316,7 +1317,7 @@ static void test_server_init(void)
     ok(stubMsg.BufferEnd == buffer + sizeof(buffer), "stubMsg.BufferEnd should have been %p instead of %p\n", buffer + sizeof(buffer), stubMsg.BufferEnd);
 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.IsClient == FALSE, "stubMsg.IsClient should have been FALSE instead of %u\n", stubMsg.IsClient);
     ok(stubMsg.ReuseBuffer == 0 ||
        broken(stubMsg.ReuseBuffer == 1), /* win2k */
        "stubMsg.ReuseBuffer should have been set to zero instead of %d\n", stubMsg.ReuseBuffer);
@@ -1459,7 +1460,7 @@ static void test_conformant_array(void)
 
     /* Server */
     my_alloc_called = 0;
-    StubMsg.IsClient = 0;
+    StubMsg.IsClient = FALSE;
     mem = NULL;
     StubMsg.Buffer = StubMsg.BufferStart;
     NdrConformantArrayUnmarshall( &StubMsg, &mem, fmtstr_conf_array, 0);
@@ -1573,7 +1574,7 @@ todo_wine {
 
     /* Server */
     my_alloc_called = 0;
-    StubMsg.IsClient = 0;
+    StubMsg.IsClient = FALSE;
     mem = NULL;
     StubMsg.Buffer = StubMsg.BufferStart;
     NdrPointerUnmarshall( &StubMsg, &mem, fmtstr_conf_str, 0);
@@ -1685,7 +1686,7 @@ static void test_nonconformant_string(void)
 
     /* Server */
     my_alloc_called = 0;
-    StubMsg.IsClient = 0;
+    StubMsg.IsClient = FALSE;
     mem = NULL;
     StubMsg.Buffer = StubMsg.BufferStart;
     NdrNonConformantStringUnmarshall( &StubMsg, &mem, fmtstr_nonconf_str, 0);
@@ -1758,7 +1759,7 @@ static void test_nonconformant_string(void)
 
     /* Server */
     my_alloc_called = 0;
-    StubMsg.IsClient = 0;
+    StubMsg.IsClient = FALSE;
     mem = NULL;
     StubMsg.Buffer = StubMsg.BufferStart;
     NdrNonConformantStringUnmarshall( &StubMsg, &mem, fmtstr_nonconf_str, 0);
@@ -1874,7 +1875,7 @@ static void test_conf_complex_struct(void)
 
     /* Server */
     my_alloc_called = 0;
-    StubMsg.IsClient = 0;
+    StubMsg.IsClient = FALSE;
     mem = NULL;
     StubMsg.Buffer = StubMsg.BufferStart;
     ptr = NdrComplexStructUnmarshall( &StubMsg, (unsigned char **)&mem, &fmtstr_complex_struct[30], 0);
@@ -2049,7 +2050,7 @@ static void test_conf_complex_array(void)
 
     /* Server */
     my_alloc_called = 0;
-    StubMsg.IsClient = 0;
+    StubMsg.IsClient = FALSE;
     mem = NULL;
     StubMsg.Buffer = StubMsg.BufferStart;
 #ifdef _WIN64
-- 
1.8.5




More information about the wine-patches mailing list