Detlef Riekenberg : mlang/tests: Some old IE versions truncate one character too short.
Alexandre Julliard
julliard at winehq.org
Thu Jun 18 09:11:35 CDT 2009
Module: wine
Branch: master
Commit: 957f52b4f358f88337f7bc35db1f9e0f90756652
URL: http://source.winehq.org/git/wine.git/?a=commit;h=957f52b4f358f88337f7bc35db1f9e0f90756652
Author: Detlef Riekenberg <wine.dev at web.de>
Date: Wed Jun 17 20:58:10 2009 +0200
mlang/tests: Some old IE versions truncate one character too short.
---
dlls/mlang/tests/mlang.c | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/dlls/mlang/tests/mlang.c b/dlls/mlang/tests/mlang.c
index 14568df..1f317f4 100644
--- a/dlls/mlang/tests/mlang.c
+++ b/dlls/mlang/tests/mlang.c
@@ -121,7 +121,7 @@ static const WCHAR de_engb[] = {'E','n','g','l','i','s','c','h',' ',
'(','G','r','o',0xDF,'b','r','i','t','a','n','n','i','e','n',')',0};
static const WCHAR de_engb2[] ={'E','n','g','l','i','s','c','h',' ',
'(','V','e','r','e','i','n','i','g','t','e','s',' ',
- 'K',0xF6,'n','i','g','r','e','i',0};
+ 'K',0xF6,'n','i','g','r','e','i','c',0};
static const WCHAR de_enus[] = {'E','n','g','l','i','s','c','h',' ',
'(','U','S','A',')',0};
static const WCHAR de_de[] = {'D','e','u','t','s','c','h',' ',
@@ -266,6 +266,17 @@ static int mylstrcmpW(const WCHAR* str1, const WCHAR* str2)
return *str1-*str2;
}
+/* lstrcpyW is not supported on Win95 */
+static void mylstrcpyW(WCHAR* str1, const WCHAR* str2)
+{
+ while (str2 && *str2) {
+ *str1 = *str2;
+ str1++;
+ str2++;
+ }
+ *str1 = '\0';
+}
+
#define DEBUGSTR_W_MAXLEN 64
static CHAR * debugstr_w(const WCHAR * strW)
@@ -1238,6 +1249,7 @@ static void test_LcidToRfc1766(void)
static void test_GetRfc1766Info(IMultiLanguage2 *iML2)
{
+ WCHAR short_broken_name[MAX_LOCALE_NAME];
CHAR rfc1766A[MAX_RFC1766_NAME + 1];
BYTE buffer[sizeof(RFC1766INFO) + 4];
PRFC1766INFO prfc = (RFC1766INFO *) buffer;
@@ -1258,16 +1270,22 @@ static void test_GetRfc1766Info(IMultiLanguage2 *iML2)
ok(!lstrcmpA(rfc1766A, info_table[i].rfc1766),
"#%02d: got '%s' (expected '%s')\n", i, rfc1766A, info_table[i].rfc1766);
+ /* Some IE versions truncate an oversized name one character to short */
+ mylstrcpyW(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( (!mylstrcmpW(prfc->wszLocaleName, info_table[i].localename)) ||
- broken(!mylstrcmpW(prfc->wszLocaleName, info_table[i].broken_name)), /* IE < 6.0 */
+ broken(!mylstrcmpW(prfc->wszLocaleName, info_table[i].broken_name)) || /* IE < 6.0 */
+ broken(!mylstrcmpW(prfc->wszLocaleName, short_broken_name)),
"#%02d: got %s (expected %s)\n", i,
debugstr_w(prfc->wszLocaleName), debugstr_w(info_table[i].localename));
}
else
ok( (!mylstrcmpW(prfc->wszLocaleName, info_table[i].localename)) ||
- broken(!mylstrcmpW(prfc->wszLocaleName, info_table[i].broken_name)), /* IE < 6.0 */
+ broken(!mylstrcmpW(prfc->wszLocaleName, info_table[i].broken_name)) || /* IE < 6.0 */
+ broken(!mylstrcmpW(prfc->wszLocaleName, short_broken_name)),
"#%02d: got %s (expected %s)\n", i,
debugstr_w(prfc->wszLocaleName), debugstr_w(info_table[i].localename));
More information about the wine-cvs
mailing list