mlang/tests: Don't call lstrcpyW on a null string.

This commit is contained in:
Dan Kegel 2011-10-17 08:24:40 -07:00 committed by Alexandre Julliard
parent acaa0dc2da
commit f91c8578bb
1 changed files with 8 additions and 4 deletions

View File

@ -1203,21 +1203,25 @@ static void test_GetRfc1766Info(IMultiLanguage2 *iML2)
"#%02d: got '%s' (expected '%s')\n", i, rfc1766A, info_table[i].rfc1766);
/* Some IE versions truncate an oversized name one character to short */
lstrcpyW(short_broken_name, info_table[i].broken_name);
short_broken_name[MAX_LOCALE_NAME - 2] = '\0';
if (info_table[i].broken_name) {
lstrcpyW(short_broken_name, info_table[i].broken_name);
short_broken_name[MAX_LOCALE_NAME - 2] = 0;
}
if (info_table[i].todo & TODO_NAME) {
todo_wine
ok( (!lstrcmpW(prfc->wszLocaleName, info_table[i].localename)) ||
(info_table[i].broken_name && (
broken(!lstrcmpW(prfc->wszLocaleName, info_table[i].broken_name)) || /* IE < 6.0 */
broken(!lstrcmpW(prfc->wszLocaleName, short_broken_name)),
broken(!lstrcmpW(prfc->wszLocaleName, short_broken_name)))),
"#%02d: got %s (expected %s)\n", i,
wine_dbgstr_w(prfc->wszLocaleName), wine_dbgstr_w(info_table[i].localename));
}
else
ok( (!lstrcmpW(prfc->wszLocaleName, info_table[i].localename)) ||
(info_table[i].broken_name && (
broken(!lstrcmpW(prfc->wszLocaleName, info_table[i].broken_name)) || /* IE < 6.0 */
broken(!lstrcmpW(prfc->wszLocaleName, short_broken_name)),
broken(!lstrcmpW(prfc->wszLocaleName, short_broken_name)))),
"#%02d: got %s (expected %s)\n", i,
wine_dbgstr_w(prfc->wszLocaleName), wine_dbgstr_w(info_table[i].localename));