Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
8588748b
Commit
8588748b
authored
Jun 02, 2009
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jun 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Fix failures on localized Windows versions.
parent
27485d9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
26 deletions
+40
-26
locale.c
dlls/kernel32/tests/locale.c
+40
-26
No files found.
dlls/kernel32/tests/locale.c
View file @
8588748b
...
...
@@ -118,45 +118,59 @@ static void InitFunctionPointers(void)
static
void
test_GetLocaleInfoA
(
void
)
{
int
ret
;
int
len
;
LCID
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
SORT_DEFAULT
);
char
buffer
[
BUFFER_SIZE
];
c
onst
char
*
expected
;
c
har
expected
[
BUFFER_SIZE
]
;
ok
(
lcid
==
0x409
,
"wrong LCID calculated - %d
\n
"
,
lcid
);
/* en, ar and zh use SUBLANG_NEUTRAL, but GetLocaleInfo assume SUBLANG_DEFAULT */
memset
(
expected
,
0
,
COUNTOF
(
expected
));
len
=
GetLocaleInfoA
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_DEFAULT
),
LOCALE_SLANGUAGE
,
expected
,
COUNTOF
(
expected
));
SetLastError
(
0xdeadbeef
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
ret
=
GetLocaleInfoA
(
LANG_ENGLISH
,
LOCALE_SLANGUAGE
,
buffer
,
COUNTOF
(
buffer
));
expected
=
"English (United States)"
;
ok
((
ret
==
(
lstrlenA
(
expected
)
+
1
))
&&
!
lstrcmpA
(
buffer
,
expected
),
"got %d with '%s' (expected %d with '%s')
\n
"
,
ret
,
buffer
,
lstrlenA
(
expected
)
+
1
,
expected
);
SetLastError
(
0xdeadbeef
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
ret
=
GetLocaleInfoA
(
LANG_ARABIC
,
LOCALE_SLANGUAGE
,
buffer
,
COUNTOF
(
buffer
));
expected
=
"Arabic (Saudi Arabia)"
;
ok
((
ret
==
(
lstrlenA
(
expected
)
+
1
))
&&
!
lstrcmpA
(
buffer
,
expected
),
"got %d with '%s' (expected %d with '%s')
\n
"
,
ret
,
buffer
,
lstrlenA
(
expected
)
+
1
,
expected
);
SetLastError
(
0xdeadbeef
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
ret
=
GetLocaleInfoA
(
LANG_CHINESE
,
LOCALE_SLANGUAGE
,
buffer
,
COUNTOF
(
buffer
));
expected
=
"Chinese (Taiwan)"
;
ok
((
ret
==
(
lstrlenA
(
expected
)
+
1
))
&&
!
lstrcmpA
(
buffer
,
expected
),
"got %d with '%s' (expected %d with '%s')
\n
"
,
ret
,
buffer
,
lstrlenA
(
expected
)
+
1
,
expected
);
ok
((
ret
==
len
)
&&
!
lstrcmpA
(
buffer
,
expected
),
"got %d with '%s' (expected %d with '%s')
\n
"
,
ret
,
buffer
,
len
,
expected
);
memset
(
expected
,
0
,
COUNTOF
(
expected
));
len
=
GetLocaleInfoA
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_DEFAULT
),
LOCALE_SLANGUAGE
,
expected
,
COUNTOF
(
expected
));
if
(
len
)
{
SetLastError
(
0xdeadbeef
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
ret
=
GetLocaleInfoA
(
LANG_ARABIC
,
LOCALE_SLANGUAGE
,
buffer
,
COUNTOF
(
buffer
));
ok
((
ret
==
len
)
&&
!
lstrcmpA
(
buffer
,
expected
),
"got %d with '%s' (expected %d with '%s')
\n
"
,
ret
,
buffer
,
len
,
expected
);
}
else
win_skip
(
"LANG_ARABIC not installed
\n
"
);
memset
(
expected
,
0
,
COUNTOF
(
expected
));
len
=
GetLocaleInfoA
(
MAKELANGID
(
LANG_CHINESE
,
SUBLANG_DEFAULT
),
LOCALE_SLANGUAGE
,
expected
,
COUNTOF
(
expected
));
if
(
len
)
{
SetLastError
(
0xdeadbeef
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
ret
=
GetLocaleInfoA
(
LANG_CHINESE
,
LOCALE_SLANGUAGE
,
buffer
,
COUNTOF
(
buffer
));
ok
((
ret
==
len
)
&&
!
lstrcmpA
(
buffer
,
expected
),
"got %d with '%s' (expected %d with '%s')
\n
"
,
ret
,
buffer
,
len
,
expected
);
}
else
win_skip
(
"LANG_CHINESE not installed
\n
"
);
/* SUBLANG_DEFAULT is not required for GetLocaleInfo */
/* SUBLANG_DEFAULT is required for mlang.dll, but optional for GetLocaleInfo */
memset
(
expected
,
0
,
COUNTOF
(
expected
));
len
=
GetLocaleInfoA
(
MAKELANGID
(
LANG_GERMAN
,
SUBLANG_DEFAULT
),
LOCALE_SLANGUAGE
,
expected
,
COUNTOF
(
expected
));
SetLastError
(
0xdeadbeef
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
ret
=
GetLocaleInfoA
(
LANG_GERMAN
,
LOCALE_SLANGUAGE
,
buffer
,
COUNTOF
(
buffer
));
expected
=
"German (Germany)"
;
ok
((
ret
==
(
lstrlenA
(
expected
)
+
1
))
&&
!
lstrcmpA
(
buffer
,
expected
)
,
"got %d with '%s' (expected %d with '%s')
\n
"
,
ret
,
buffer
,
lstrlenA
(
expected
)
+
1
,
expected
);
ok
((
ret
==
len
)
&&
!
lstrcmpA
(
buffer
,
expected
),
"got %d with '%s' (expected %d with '%s')
\n
"
,
ret
,
buffer
,
len
,
expected
);
/* HTMLKit and "Font xplorer lite" expect GetLocaleInfoA to
* partially fill the buffer even if it is too short. See bug 637.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment