Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
74459389
Commit
74459389
authored
Sep 15, 2011
by
Francois Gouget
Committed by
Alexandre Julliard
Sep 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi/tests: Some tests require that the user interface be in English.
With MUI versions of Windows checking for the default user language id or locale is insufficient.
parent
49a54568
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
4 deletions
+40
-4
string.c
dlls/shlwapi/tests/string.c
+40
-4
No files found.
dlls/shlwapi/tests/string.c
View file @
74459389
...
...
@@ -197,6 +197,39 @@ static const StrFromTimeIntervalResult StrFromTimeInterval_results[] = {
{
0
,
0
,
NULL
}
};
/* Returns true if the user interface is in English. Note that this does not
* presume of the formatting of dates, numbers, etc.
*/
static
BOOL
is_lang_english
(
void
)
{
static
HMODULE
hkernel32
=
NULL
;
static
LANGID
(
WINAPI
*
pGetThreadUILanguage
)(
void
)
=
NULL
;
static
LANGID
(
WINAPI
*
pGetUserDefaultUILanguage
)(
void
)
=
NULL
;
if
(
!
hkernel32
)
{
hkernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
pGetThreadUILanguage
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetThreadUILanguage"
);
pGetUserDefaultUILanguage
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetUserDefaultUILanguage"
);
}
if
(
pGetThreadUILanguage
)
return
PRIMARYLANGID
(
pGetThreadUILanguage
())
==
LANG_ENGLISH
;
if
(
pGetUserDefaultUILanguage
)
return
PRIMARYLANGID
(
pGetUserDefaultUILanguage
())
==
LANG_ENGLISH
;
return
PRIMARYLANGID
(
GetUserDefaultLangID
())
==
LANG_ENGLISH
;
}
/* Returns true if the dates, numbers, etc. are formatted using English
* conventions.
*/
static
BOOL
is_locale_english
(
void
)
{
/* Surprisingly GetThreadLocale() is irrelevant here */
return
PRIMARYLANGID
(
GetUserDefaultLangID
())
==
LANG_ENGLISH
;
}
static
void
test_StrChrA
(
void
)
{
char
string
[
129
];
...
...
@@ -1405,15 +1438,18 @@ START_TEST(string)
test_StrDupA
();
/* language-dependent test */
if
(
PRIMARYLANGID
(
GetUserDefaultLangID
())
!=
LANG_ENGLISH
)
skip
(
"English is required for StrFromTimeInterval and StrFormat*Size tests
\n
"
);
else
if
(
is_lang_english
()
&&
is_locale_english
())
{
test_StrFormatByteSize64A
();
test_StrFormatKBSizeA
();
test_StrFormatKBSizeW
();
test_StrFromTimeIntervalA
();
}
else
skip
(
"An English UI and locale is required for the StrFormat*Size tests
\n
"
);
if
(
is_lang_english
())
test_StrFromTimeIntervalA
();
else
skip
(
"An English UI is required for the StrFromTimeInterval tests
\n
"
);
test_StrCmpA
();
test_StrCmpW
();
...
...
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