Alexandre Julliard : user32/tests: Get rid of strncmpW() and strcpyW().

Alexandre Julliard julliard at winehq.org
Mon Jan 27 15:00:15 CST 2020


Module: wine
Branch: master
Commit: b933b5d06b3b3c02dbcdd352f8c2f858a6048412
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b933b5d06b3b3c02dbcdd352f8c2f858a6048412

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sun Jan 26 10:58:40 2020 +0100

user32/tests: Get rid of strncmpW() and strcpyW().

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/menu.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c
index de0828365c..1ca4141957 100644
--- a/dlls/user32/tests/menu.c
+++ b/dlls/user32/tests/menu.c
@@ -1202,21 +1202,6 @@ static void test_menu_add_string( void )
     DestroyMenu( hmenu );
 }
 
-/* define building blocks for the menu item info tests */
-static int strncmpW( const WCHAR *str1, const WCHAR *str2, int n )
-{
-    if (n <= 0) return 0;
-    while ((--n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; }
-    return *str1 - *str2;
-}
-
-static  WCHAR *strcpyW( WCHAR *dst, const WCHAR *src )
-{
-    WCHAR *p = dst;
-    while ((*p++ = *src++));
-    return dst;
-}
-
 static void insert_menu_item( int line, HMENU hmenu, BOOL ansi, UINT mask, UINT type, UINT state, UINT id,
                               HMENU submenu, HBITMAP checked, HBITMAP unchecked, ULONG_PTR data,
                               void *type_data, UINT len, HBITMAP item, BOOL expect )
@@ -1307,7 +1292,7 @@ static void check_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, U
             ok_(__FILE__, line)( !strncmp( expname, info.dwTypeData, out_len ),
                                  "menu item name differed from '%s' '%s'\n", expname, info.dwTypeData );
         else
-            ok_(__FILE__, line)( !strncmpW( (WCHAR *)expname, (WCHAR *)info.dwTypeData, out_len ),
+            ok_(__FILE__, line)( !wcsncmp( (WCHAR *)expname, (WCHAR *)info.dwTypeData, out_len ),
                                  "menu item name wrong\n" );
 
         SetLastError( 0xdeadbeef );
@@ -1364,7 +1349,7 @@ static void set_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, UIN
     hmenu = CreateMenu();\
     submenu = CreateMenu();\
     if(ansi)strcpy( string, init );\
-    else strcpyW( string, init );\
+    else wcscpy( string, init );\
     insert_menu_item( __LINE__, hmenu, ansi, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, eret1 )
 
 /* GetMenuItemInfo + GetMenuString  */




More information about the wine-cvs mailing list