user32/tests: Don't run unicode tests if not supported.
This commit is contained in:
parent
f5678a4d38
commit
9707a2de58
|
@ -526,6 +526,7 @@ static void test_menu_add_string( void )
|
||||||
HMENU hmenu;
|
HMENU hmenu;
|
||||||
MENUITEMINFO info;
|
MENUITEMINFO info;
|
||||||
BOOL rc;
|
BOOL rc;
|
||||||
|
int ret;
|
||||||
|
|
||||||
char string[0x80];
|
char string[0x80];
|
||||||
char string2[0x80];
|
char string2[0x80];
|
||||||
|
@ -571,8 +572,15 @@ static void test_menu_add_string( void )
|
||||||
ok (GetMenuString( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n");
|
ok (GetMenuString( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n");
|
||||||
ok (!strcmp( strback, "Dummy string" ), "Menu text from Ansi version incorrect\n");
|
ok (!strcmp( strback, "Dummy string" ), "Menu text from Ansi version incorrect\n");
|
||||||
|
|
||||||
ok (GetMenuStringW( hmenu, 0, (WCHAR *)strbackW, 99, MF_BYPOSITION), "GetMenuStringW on ownerdraw entry failed\n");
|
SetLastError(0xdeadbeef);
|
||||||
ok (!lstrcmpW( strbackW, expectedString ), "Menu text from Unicode version incorrect\n");
|
ret = GetMenuStringW( hmenu, 0, (WCHAR *)strbackW, 99, MF_BYPOSITION);
|
||||||
|
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
|
||||||
|
skip("GetMenuStringW is not implemented\n");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ok (ret, "GetMenuStringW on ownerdraw entry failed\n");
|
||||||
|
ok (!lstrcmpW( strbackW, expectedString ), "Menu text from Unicode version incorrect\n");
|
||||||
|
}
|
||||||
|
|
||||||
/* Just change ftype to string and see what text is stored */
|
/* Just change ftype to string and see what text is stored */
|
||||||
memset(&info, 0x00, sizeof(info));
|
memset(&info, 0x00, sizeof(info));
|
||||||
|
@ -627,9 +635,12 @@ static void test_menu_add_string( void )
|
||||||
ok (rc, "InsertMenuItem failed\n");
|
ok (rc, "InsertMenuItem failed\n");
|
||||||
ok (!GetMenuString( hmenu, 0, NULL, 0, MF_BYPOSITION),
|
ok (!GetMenuString( hmenu, 0, NULL, 0, MF_BYPOSITION),
|
||||||
"GetMenuString on ownerdraw entry succeeded.\n");
|
"GetMenuString on ownerdraw entry succeeded.\n");
|
||||||
ok (!GetMenuStringW( hmenu, 0, NULL, 0, MF_BYPOSITION),
|
SetLastError(0xdeadbeef);
|
||||||
"GetMenuStringW on ownerdraw entry succeeded.\n");
|
ret = GetMenuStringW( hmenu, 0, NULL, 0, MF_BYPOSITION);
|
||||||
|
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
|
||||||
|
skip("GetMenuStringW is not implemented\n");
|
||||||
|
else
|
||||||
|
ok (!ret, "GetMenuStringW on ownerdraw entry succeeded.\n");
|
||||||
|
|
||||||
DestroyMenu( hmenu );
|
DestroyMenu( hmenu );
|
||||||
}
|
}
|
||||||
|
@ -681,6 +692,11 @@ static WCHAR *strcpyW( WCHAR *dst, const WCHAR *src )
|
||||||
else strcpyW( (WCHAR*)string, (WCHAR*)init);\
|
else strcpyW( (WCHAR*)string, (WCHAR*)init);\
|
||||||
if( ansi) ret = InsertMenuItemA(hmenu, 0, TRUE, &info1 );\
|
if( ansi) ret = InsertMenuItemA(hmenu, 0, TRUE, &info1 );\
|
||||||
else ret = InsertMenuItemW(hmenu, 0, TRUE, (MENUITEMINFOW*)&info1 );\
|
else ret = InsertMenuItemW(hmenu, 0, TRUE, (MENUITEMINFOW*)&info1 );\
|
||||||
|
if( GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)\
|
||||||
|
{\
|
||||||
|
skip("InsertMenuItem%s not implemented\n", ansi ? "A" : "W");\
|
||||||
|
break;\
|
||||||
|
}\
|
||||||
if( !(eret1)) { ok( (eret1)==ret,"InsertMenuItem should have failed.\n");\
|
if( !(eret1)) { ok( (eret1)==ret,"InsertMenuItem should have failed.\n");\
|
||||||
stop = TRUE;\
|
stop = TRUE;\
|
||||||
} else ok( (eret1)==ret,"InsertMenuItem failed, err %d\n",GetLastError());\
|
} else ok( (eret1)==ret,"InsertMenuItem failed, err %d\n",GetLastError());\
|
||||||
|
@ -697,8 +713,14 @@ static WCHAR *strcpyW( WCHAR *dst, const WCHAR *src )
|
||||||
MENUITEMINFOA *einfo = &einfoA;\
|
MENUITEMINFOA *einfo = &einfoA;\
|
||||||
MENUITEMINFOW *info2W = (MENUITEMINFOW *)&info2A;\
|
MENUITEMINFOW *info2W = (MENUITEMINFOW *)&info2A;\
|
||||||
if( !stop) {\
|
if( !stop) {\
|
||||||
|
SetLastError( 0xdeadbeef);\
|
||||||
ret = ansi ? GetMenuItemInfoA( hmenu, 0, TRUE, info2 ) :\
|
ret = ansi ? GetMenuItemInfoA( hmenu, 0, TRUE, info2 ) :\
|
||||||
GetMenuItemInfoW( hmenu, 0, TRUE, info2W );\
|
GetMenuItemInfoW( hmenu, 0, TRUE, info2W );\
|
||||||
|
if( GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)\
|
||||||
|
{\
|
||||||
|
skip("GetMenuItemInfo%s not implemented\n", ansi ? "A" : "W");\
|
||||||
|
break;\
|
||||||
|
}\
|
||||||
if( !(eret2)) ok( (eret2)==ret,"GetMenuItemInfo should have failed.\n");\
|
if( !(eret2)) ok( (eret2)==ret,"GetMenuItemInfo should have failed.\n");\
|
||||||
else { \
|
else { \
|
||||||
ok( (eret2)==ret,"GetMenuItemInfo failed, err %d\n",GetLastError());\
|
ok( (eret2)==ret,"GetMenuItemInfo failed, err %d\n",GetLastError());\
|
||||||
|
@ -730,8 +752,14 @@ submenu = CreateMenu();\
|
||||||
/* modify menu */
|
/* modify menu */
|
||||||
#define TMII_MODM( flags, id, data, eret )\
|
#define TMII_MODM( flags, id, data, eret )\
|
||||||
if( !stop) {\
|
if( !stop) {\
|
||||||
|
SetLastError( 0xdeadbeef);\
|
||||||
if(ansi)ret = ModifyMenuA( hmenu, 0, flags, (UINT_PTR)id, (char*)data);\
|
if(ansi)ret = ModifyMenuA( hmenu, 0, flags, (UINT_PTR)id, (char*)data);\
|
||||||
else ret = ModifyMenuW( hmenu, 0, flags, (UINT_PTR)id, (WCHAR*)data);\
|
else ret = ModifyMenuW( hmenu, 0, flags, (UINT_PTR)id, (WCHAR*)data);\
|
||||||
|
if( GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)\
|
||||||
|
{\
|
||||||
|
skip("ModifyMenu%s not implemented\n", ansi ? "A" : "W");\
|
||||||
|
break;\
|
||||||
|
}\
|
||||||
if( !(eret)) ok( (eret)==ret,"ModifyMenuA should have failed.\n");\
|
if( !(eret)) ok( (eret)==ret,"ModifyMenuA should have failed.\n");\
|
||||||
else ok( (eret)==ret,"ModifyMenuA failed, err %d\n",GetLastError());\
|
else ok( (eret)==ret,"ModifyMenuA failed, err %d\n",GetLastError());\
|
||||||
}
|
}
|
||||||
|
@ -746,6 +774,11 @@ if( !stop) {\
|
||||||
else strcpyW( (WCHAR*)string, (WCHAR*)init);\
|
else strcpyW( (WCHAR*)string, (WCHAR*)init);\
|
||||||
if( ansi) ret = SetMenuItemInfoA(hmenu, 0, TRUE, &info1 );\
|
if( ansi) ret = SetMenuItemInfoA(hmenu, 0, TRUE, &info1 );\
|
||||||
else ret = SetMenuItemInfoW(hmenu, 0, TRUE, (MENUITEMINFOW*)&info1 );\
|
else ret = SetMenuItemInfoW(hmenu, 0, TRUE, (MENUITEMINFOW*)&info1 );\
|
||||||
|
if( GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)\
|
||||||
|
{\
|
||||||
|
skip("SetMenuItemInfo%s not implemented\n", ansi ? "A" : "W");\
|
||||||
|
break;\
|
||||||
|
}\
|
||||||
if( !(eret1)) { ok( (eret1)==ret,"InsertMenuItem should have failed.\n");\
|
if( !(eret1)) { ok( (eret1)==ret,"InsertMenuItem should have failed.\n");\
|
||||||
stop = TRUE;\
|
stop = TRUE;\
|
||||||
} else ok( (eret1)==ret,"InsertMenuItem failed, err %d\n",GetLastError());\
|
} else ok( (eret1)==ret,"InsertMenuItem failed, err %d\n",GetLastError());\
|
||||||
|
|
Loading…
Reference in New Issue