Add trailing '\n's to ok() calls (netapi32)

Francois Gouget fgouget at free.fr
Tue Jan 27 11:05:14 CST 2004


Changelog:

 * dlls/netapi32/tests/access.c
   dlls/netapi32/tests/apibuf.c
   dlls/netapi32/tests/wksta.c

   Add trailing '\n's to ok() calls.


Index: dlls/netapi32/tests/access.c
===================================================================
RCS file: /home/cvs/wine/dlls/netapi32/tests/access.c,v
retrieving revision 1.4
diff -u -r1.4 access.c
--- dlls/netapi32/tests/access.c	25 Sep 2003 20:29:41 -0000	1.4
+++ dlls/netapi32/tests/access.c	24 Jan 2004 20:03:41 -0000
@@ -56,11 +56,11 @@
     rc=GetUserNameW(user_name, &dwSize);
     if (rc==FALSE && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED)
         return 0;
-    ok(rc, "User Name Retrieved");
+    ok(rc, "User Name Retrieved\n");

     computer_name[0] = 0;
     dwSize = sizeof(computer_name);
-    ok(GetComputerNameW(computer_name, &dwSize), "Computer Name Retrieved");
+    ok(GetComputerNameW(computer_name, &dwSize), "Computer Name Retrieved\n");
     return 1;
 }

@@ -77,45 +77,45 @@

     /* Level 0 */
     rc=pNetUserGetInfo(NULL, sAdminUserName, 0, (LPBYTE *)&ui0);
-    ok(rc == NERR_Success, "NetUserGetInfo: rc=%ld", rc);
-    ok(!lstrcmpW(sAdminUserName, ui0->usri0_name), "This is really user name");
+    ok(rc == NERR_Success, "NetUserGetInfo: rc=%ld\n", rc);
+    ok(!lstrcmpW(sAdminUserName, ui0->usri0_name), "This is really user name\n");
     pNetApiBufferSize(ui0, &dwSize);
     ok(dwSize >= (sizeof(USER_INFO_0) +
                   (lstrlenW(ui0->usri0_name) + 1) * sizeof(WCHAR)),
-       "Is allocated with NetApiBufferAllocate");
+       "Is allocated with NetApiBufferAllocate\n");

     /* Level 10 */
     rc=pNetUserGetInfo(NULL, sAdminUserName, 10, (LPBYTE *)&ui10);
-    ok(rc == NERR_Success, "NetUserGetInfo: rc=%ld", rc);
-    ok(!lstrcmpW(sAdminUserName, ui10->usri10_name), "This is really user name");
+    ok(rc == NERR_Success, "NetUserGetInfo: rc=%ld\n", rc);
+    ok(!lstrcmpW(sAdminUserName, ui10->usri10_name), "This is really user name\n");
     pNetApiBufferSize(ui10, &dwSize);
     ok(dwSize >= (sizeof(USER_INFO_10) +
                   (lstrlenW(ui10->usri10_name) + 1 +
                    lstrlenW(ui10->usri10_comment) + 1 +
                    lstrlenW(ui10->usri10_usr_comment) + 1 +
                    lstrlenW(ui10->usri10_full_name) + 1) * sizeof(WCHAR)),
-       "Is allocated with NetApiBufferAllocate");
+       "Is allocated with NetApiBufferAllocate\n");

     pNetApiBufferFree(ui0);
     pNetApiBufferFree(ui10);

     /* errors handling */
     rc=pNetUserGetInfo(NULL, sAdminUserName, 10000, (LPBYTE *)&ui0);
-    ok(rc == ERROR_INVALID_LEVEL,"Invalid Level: rc=%ld",rc);
+    ok(rc == ERROR_INVALID_LEVEL,"Invalid Level: rc=%ld\n",rc);
     rc=pNetUserGetInfo(NULL, sNonexistentUser, 0, (LPBYTE *)&ui0);
-    ok(rc == NERR_UserNotFound,"Invalid User Name: rc=%ld",rc);
+    ok(rc == NERR_UserNotFound,"Invalid User Name: rc=%ld\n",rc);
     todo_wine {
         /* FIXME - Currently Wine can't verify whether the network path is good or bad */
         rc=pNetUserGetInfo(sBadNetPath, sAdminUserName, 0, (LPBYTE *)&ui0);
         ok(rc == ERROR_BAD_NETPATH || rc == ERROR_NETWORK_UNREACHABLE,
-           "Bad Network Path: rc=%ld",rc);
+           "Bad Network Path: rc=%ld\n",rc);
     }
     rc=pNetUserGetInfo(sEmptyStr, sAdminUserName, 0, (LPBYTE *)&ui0);
-    ok(rc == ERROR_BAD_NETPATH,"Bad Network Path: rc=%ld",rc);
+    ok(rc == ERROR_BAD_NETPATH,"Bad Network Path: rc=%ld\n",rc);
     rc=pNetUserGetInfo(sInvalidName, sAdminUserName, 0, (LPBYTE *)&ui0);
-    ok(rc == ERROR_INVALID_NAME,"Invalid Server Name: rc=%ld",rc);
+    ok(rc == ERROR_INVALID_NAME,"Invalid Server Name: rc=%ld\n",rc);
     rc=pNetUserGetInfo(sInvalidName2, sAdminUserName, 0, (LPBYTE *)&ui0);
-    ok(rc == ERROR_INVALID_NAME,"Invalid Server Name: rc=%ld",rc);
+    ok(rc == ERROR_INVALID_NAME,"Invalid Server Name: rc=%ld\n",rc);
 }

 /* checks Level 1 of NetQueryDisplayInformation */
@@ -137,22 +137,22 @@
             (PVOID *)&Buffer);

         ok((Result == ERROR_SUCCESS) || (Result == ERROR_MORE_DATA),
-           "Information Retrieved");
+           "Information Retrieved\n");
         rec = Buffer;
         for(; EntryCount > 0; EntryCount--)
         {
             if (!lstrcmpW(rec->usri1_name, sAdminUserName))
             {
-                ok(!hasAdmin, "One admin user");
-                ok(rec->usri1_flags & UF_SCRIPT, "UF_SCRIPT flag is set");
-                ok(rec->usri1_flags & UF_NORMAL_ACCOUNT, "UF_NORMAL_ACCOUNT flag is set");
+                ok(!hasAdmin, "One admin user\n");
+                ok(rec->usri1_flags & UF_SCRIPT, "UF_SCRIPT flag is set\n");
+                ok(rec->usri1_flags & UF_NORMAL_ACCOUNT, "UF_NORMAL_ACCOUNT flag is set\n");
                 hasAdmin = TRUE;
             }
             else if (!lstrcmpW(rec->usri1_name, sGuestUserName))
             {
-                ok(!hasGuest, "One guest record");
-                ok(rec->usri1_flags & UF_SCRIPT, "UF_SCRIPT flag is set");
-                ok(rec->usri1_flags & UF_NORMAL_ACCOUNT, "UF_NORMAL_ACCOUNT flag is set");
+                ok(!hasGuest, "One guest record\n");
+                ok(rec->usri1_flags & UF_SCRIPT, "UF_SCRIPT flag is set\n");
+                ok(rec->usri1_flags & UF_NORMAL_ACCOUNT, "UF_NORMAL_ACCOUNT flag is set\n");
                 hasGuest = TRUE;
             }

@@ -163,8 +163,8 @@
         pNetApiBufferFree(Buffer);
     } while (Result == ERROR_MORE_DATA);

-    ok(hasAdmin, "Has Administrator account");
-    ok(hasGuest, "Has Guest account");
+    ok(hasAdmin, "Has Administrator account\n");
+    ok(hasGuest, "Has Guest account\n");
 }

 START_TEST(access)
Index: dlls/netapi32/tests/apibuf.c
===================================================================
RCS file: /home/cvs/wine/dlls/netapi32/tests/apibuf.c,v
retrieving revision 1.4
diff -u -r1.4 apibuf.c
--- dlls/netapi32/tests/apibuf.c	4 Dec 2003 01:42:34 -0000	1.4
+++ dlls/netapi32/tests/apibuf.c	24 Jan 2004 20:03:41 -0000
@@ -45,37 +45,37 @@

     /* test normal logic */
     ok(pNetApiBufferAllocate(1024, (LPVOID *)&p) == NERR_Success,
-       "Reserved memory");
-    ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
-    ok(dwSize >= 1024, "The size is correct");
+       "Reserved memory\n");
+    ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n");
+    ok(dwSize >= 1024, "The size is correct\n");

     ok(pNetApiBufferReallocate(p, 1500, (LPVOID *) &p) == NERR_Success,
-       "Reallocated");
-    ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
-    ok(dwSize >= 1500, "The size is correct");
+       "Reallocated\n");
+    ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n");
+    ok(dwSize >= 1500, "The size is correct\n");

-    ok(pNetApiBufferFree(p) == NERR_Success, "Freed");
+    ok(pNetApiBufferFree(p) == NERR_Success, "Freed\n");

     /* test errors handling */
-    ok(pNetApiBufferFree(p) == NERR_Success, "Freed");
+    ok(pNetApiBufferFree(p) == NERR_Success, "Freed\n");

-    ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
-    ok(dwSize >= 0, "The size");
-    ok(pNetApiBufferSize(NULL, &dwSize) == ERROR_INVALID_PARAMETER, "Error for NULL pointer");
+    ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n");
+    ok(dwSize >= 0, "The size\n");
+    ok(pNetApiBufferSize(NULL, &dwSize) == ERROR_INVALID_PARAMETER, "Error for NULL pointer\n");

     /* border reallocate cases */
-    ok(pNetApiBufferReallocate(0, 1500, (LPVOID *) &p) != NERR_Success, "(Re)allocated");
-    ok(p == NULL, "Some memory got allocated");
-    ok(pNetApiBufferAllocate(1024, (LPVOID *)&p) == NERR_Success, "Memory not reserved");
-    ok(pNetApiBufferReallocate(p, 0, (LPVOID *) &p) == NERR_Success, "Not freed");
-    ok(p == NULL, "Pointer not cleared");
+    ok(pNetApiBufferReallocate(0, 1500, (LPVOID *) &p) != NERR_Success, "(Re)allocated\n");
+    ok(p == NULL, "Some memory got allocated\n");
+    ok(pNetApiBufferAllocate(1024, (LPVOID *)&p) == NERR_Success, "Memory not reserved\n");
+    ok(pNetApiBufferReallocate(p, 0, (LPVOID *) &p) == NERR_Success, "Not freed\n");
+    ok(p == NULL, "Pointer not cleared\n");

     /* 0-length buffer */
     ok(pNetApiBufferAllocate(0, (LPVOID *)&p) == NERR_Success,
-       "Reserved memory");
-    ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
-    ok((dwSize >= 0) && (dwSize < 0xFFFFFFFF),"The size of the 0-length buffer");
-    ok(pNetApiBufferFree(p) == NERR_Success, "Freed");
+       "Reserved memory\n");
+    ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n");
+    ok((dwSize >= 0) && (dwSize < 0xFFFFFFFF),"The size of the 0-length buffer\n");
+    ok(pNetApiBufferFree(p) == NERR_Success, "Freed\n");
 }

 START_TEST(apibuf)
Index: dlls/netapi32/tests/wksta.c
===================================================================
RCS file: /home/cvs/wine/dlls/netapi32/tests/wksta.c,v
retrieving revision 1.9
diff -u -r1.9 wksta.c
--- dlls/netapi32/tests/wksta.c	25 Sep 2003 20:29:41 -0000	1.9
+++ dlls/netapi32/tests/wksta.c	24 Jan 2004 20:03:41 -0000
@@ -52,11 +52,11 @@
     rc=GetUserNameW(user_name, &dwSize);
     if (rc==FALSE && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED)
         return 0;
-    ok(rc, "User Name Retrieved");
+    ok(rc, "User Name Retrieved\n");

     computer_name[0] = 0;
     dwSize = sizeof(computer_name);
-    ok(GetComputerNameW(computer_name, &dwSize), "Computer Name Retrieved");
+    ok(GetComputerNameW(computer_name, &dwSize), "Computer Name Retrieved\n");
     return 1;
 }

@@ -67,8 +67,8 @@
     if (!pNetpGetComputerName)
         return;

-    ok(pNetpGetComputerName(&ws) == NERR_Success, "Computer name is retrieved");
-    ok(!lstrcmpW(computer_name, ws), "This is really computer name");
+    ok(pNetpGetComputerName(&ws) == NERR_Success, "Computer name is retrieved\n");
+    ok(!lstrcmpW(computer_name, ws), "This is really computer name\n");
     pNetApiBufferFree(ws);
 }

@@ -84,35 +84,35 @@

     /* Level 0 */
     ok(pNetWkstaUserGetInfo(NULL, 0, (LPBYTE *)&ui0) == NERR_Success,
-       "NetWkstaUserGetInfo is successful");
-    ok(!lstrcmpW(user_name, ui0->wkui0_username), "This is really user name");
+       "NetWkstaUserGetInfo is successful\n");
+    ok(!lstrcmpW(user_name, ui0->wkui0_username), "This is really user name\n");
     pNetApiBufferSize(ui0, &dwSize);
     ok(dwSize >= (sizeof(WKSTA_USER_INFO_0) +
                  lstrlenW(ui0->wkui0_username) * sizeof(WCHAR)),
-       "Is allocated with NetApiBufferAllocate");
+       "Is allocated with NetApiBufferAllocate\n");

     /* Level 1 */
     ok(pNetWkstaUserGetInfo(NULL, 1, (LPBYTE *)&ui1) == NERR_Success,
-       "NetWkstaUserGetInfo is successful");
+       "NetWkstaUserGetInfo is successful\n");
     ok(lstrcmpW(ui1->wkui1_username, ui0->wkui0_username) == 0,
-       "the same name as returned for level 0");
+       "the same name as returned for level 0\n");
     pNetApiBufferSize(ui1, &dwSize);
     ok(dwSize >= (sizeof(WKSTA_USER_INFO_1) +
                   (lstrlenW(ui1->wkui1_username) +
                    lstrlenW(ui1->wkui1_logon_domain) +
                    lstrlenW(ui1->wkui1_oth_domains) +
                    lstrlenW(ui1->wkui1_logon_server)) * sizeof(WCHAR)),
-       "Is allocated with NetApiBufferAllocate");
+       "Is allocated with NetApiBufferAllocate\n");

     /* Level 1101 */
     ok(pNetWkstaUserGetInfo(NULL, 1101, (LPBYTE *)&ui1101) == NERR_Success,
-       "NetWkstaUserGetInfo is successful");
+       "NetWkstaUserGetInfo is successful\n");
     ok(lstrcmpW(ui1101->wkui1101_oth_domains, ui1->wkui1_oth_domains) == 0,
-       "the same oth_domains as returned for level 1");
+       "the same oth_domains as returned for level 1\n");
     pNetApiBufferSize(ui1101, &dwSize);
     ok(dwSize >= (sizeof(WKSTA_USER_INFO_1101) +
                  lstrlenW(ui1101->wkui1101_oth_domains) * sizeof(WCHAR)),
-       "Is allocated with NetApiBufferAllocate");
+       "Is allocated with NetApiBufferAllocate\n");

     pNetApiBufferFree(ui0);
     pNetApiBufferFree(ui1);
@@ -120,7 +120,7 @@

     /* errors handling */
     ok(pNetWkstaUserGetInfo(NULL, 10000, (LPBYTE *)&ui0) == ERROR_INVALID_LEVEL,
-       "Invalid level");
+       "Invalid level\n");
 }

 static void run_wkstatransportenum_tests(void)
@@ -136,7 +136,7 @@
     apiReturn = pNetWkstaTransportEnum(NULL, 1, NULL, MAX_PREFERRED_LENGTH,
         NULL, &totalEntries, NULL);
     ok(apiReturn == ERROR_INVALID_LEVEL || apiReturn == ERROR_INVALID_PARAMETER,
-       "NetWkstaTransportEnum returned %ld", apiReturn);
+       "NetWkstaTransportEnum returned %ld\n", apiReturn);

     /* 2nd check: is param 5 passed? (only if level passes?) */
     apiReturn = pNetWkstaTransportEnum(NULL, 0, NULL, MAX_PREFERRED_LENGTH,
@@ -147,30 +147,30 @@
         return;

     ok(apiReturn == STATUS_ACCESS_VIOLATION || apiReturn == ERROR_INVALID_PARAMETER,
-       "NetWkstaTransportEnum returned %ld", apiReturn);
+       "NetWkstaTransportEnum returned %ld\n", apiReturn);

     /* 3rd check: is param 3 passed? */
     apiReturn = pNetWkstaTransportEnum(NULL, 0, NULL, MAX_PREFERRED_LENGTH,
         NULL, NULL, NULL);
     ok(apiReturn == STATUS_ACCESS_VIOLATION || apiReturn == ERROR_INVALID_PARAMETER,
-       "NetWkstaTransportEnum returned %ld", apiReturn);
+       "NetWkstaTransportEnum returned %ld\n", apiReturn);

     /* 4th check: is param 6 passed? */
     apiReturn = pNetWkstaTransportEnum(NULL, 0, &bufPtr, MAX_PREFERRED_LENGTH,
         &entriesRead, NULL, NULL);
-    ok(apiReturn == RPC_X_NULL_REF_POINTER, "null pointer");
+    ok(apiReturn == RPC_X_NULL_REF_POINTER, "null pointer\n");

     /* final check: valid return, actually get data back */
     apiReturn = pNetWkstaTransportEnum(NULL, 0, &bufPtr, MAX_PREFERRED_LENGTH,
         &entriesRead, &totalEntries, NULL);
     ok(apiReturn == NERR_Success || apiReturn == ERROR_NETWORK_UNREACHABLE,
-       "NetWkstaTransportEnum returned %ld", apiReturn);
+       "NetWkstaTransportEnum returned %ld\n", apiReturn);
     if (apiReturn == NERR_Success) {
         /* WKSTA_TRANSPORT_INFO_0 *transports = (WKSTA_TRANSPORT_INFO_0 *)bufPtr; */

-        ok(bufPtr != NULL, "got data back");
-        ok(entriesRead > 0, "read at least one transport");
-        ok(totalEntries > 0, "at least one transport");
+        ok(bufPtr != NULL, "got data back\n");
+        ok(entriesRead > 0, "read at least one transport\n");
+        ok(totalEntries > 0, "at least one transport\n");
         pNetApiBufferFree(bufPtr);
     }
 }



-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
        War doesn't determine who's right.  War determines who's left.



More information about the wine-patches mailing list