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
cac04651
Commit
cac04651
authored
Mar 02, 2020
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add more tests for Get[*]PreferredUILanguages APIs.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9870f932
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
1 deletion
+62
-1
locale.c
dlls/kernel32/tests/locale.c
+62
-1
No files found.
dlls/kernel32/tests/locale.c
View file @
cac04651
...
@@ -5461,12 +5461,24 @@ static void test_GetSystemPreferredUILanguages(void)
...
@@ -5461,12 +5461,24 @@ static void test_GetSystemPreferredUILanguages(void)
"Expected last two WCHARs being empty, got 0x%x 0x%x
\n
"
,
"Expected last two WCHARs being empty, got 0x%x 0x%x
\n
"
,
buffer
[
size
-
2
],
buffer
[
size
-
1
]);
buffer
[
size
-
2
],
buffer
[
size
-
1
]);
size
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
pGetSystemPreferredUILanguages
(
MUI_LANGUAGE_ID
,
&
count
,
buffer
,
&
size
);
todo_wine
ok
(
!
ret
,
"Expected GetSystemPreferredUILanguages to fail
\n
"
);
todo_wine
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
ok
(
size
==
size_id
,
"expected %u, got %u
\n
"
,
size_id
,
size
);
size
=
1
;
size
=
1
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetSystemPreferredUILanguages
(
MUI_LANGUAGE_ID
,
&
count
,
buffer
,
&
size
);
ret
=
pGetSystemPreferredUILanguages
(
MUI_LANGUAGE_ID
,
&
count
,
buffer
,
&
size
);
ok
(
!
ret
,
"Expected GetSystemPreferredUILanguages to fail
\n
"
);
ok
(
!
ret
,
"Expected GetSystemPreferredUILanguages to fail
\n
"
);
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
size
==
size_id
,
"expected %u, got %u
\n
"
,
size_id
,
size
);
size
=
size_id
-
1
;
size
=
size_id
-
1
;
memset
(
buffer
,
0x5a
,
size_buffer
*
sizeof
(
WCHAR
));
memset
(
buffer
,
0x5a
,
size_buffer
*
sizeof
(
WCHAR
));
...
@@ -5475,6 +5487,8 @@ static void test_GetSystemPreferredUILanguages(void)
...
@@ -5475,6 +5487,8 @@ static void test_GetSystemPreferredUILanguages(void)
ok
(
!
ret
,
"Expected GetSystemPreferredUILanguages to fail
\n
"
);
ok
(
!
ret
,
"Expected GetSystemPreferredUILanguages to fail
\n
"
);
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
size
==
size_id
,
"expected %u, got %u
\n
"
,
size_id
,
size
);
size
=
size_id
-
2
;
size
=
size_id
-
2
;
memset
(
buffer
,
0x5a
,
size_buffer
*
sizeof
(
WCHAR
));
memset
(
buffer
,
0x5a
,
size_buffer
*
sizeof
(
WCHAR
));
...
@@ -5483,6 +5497,8 @@ static void test_GetSystemPreferredUILanguages(void)
...
@@ -5483,6 +5497,8 @@ static void test_GetSystemPreferredUILanguages(void)
ok
(
!
ret
,
"Expected GetSystemPreferredUILanguages to fail
\n
"
);
ok
(
!
ret
,
"Expected GetSystemPreferredUILanguages to fail
\n
"
);
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
size
==
size_id
+
2
||
size
==
size_id
+
1
/* before win10 1809 */
,
"expected %u, got %u
\n
"
,
size_id
+
2
,
size
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
}
...
@@ -5490,7 +5506,7 @@ static void test_GetSystemPreferredUILanguages(void)
...
@@ -5490,7 +5506,7 @@ static void test_GetSystemPreferredUILanguages(void)
static
void
test_GetThreadPreferredUILanguages
(
void
)
static
void
test_GetThreadPreferredUILanguages
(
void
)
{
{
BOOL
ret
;
BOOL
ret
;
ULONG
count
,
size
;
ULONG
count
,
size
,
size_id
;
WCHAR
*
buf
;
WCHAR
*
buf
;
if
(
!
pGetThreadPreferredUILanguages
)
if
(
!
pGetThreadPreferredUILanguages
)
...
@@ -5510,6 +5526,51 @@ static void test_GetThreadPreferredUILanguages(void)
...
@@ -5510,6 +5526,51 @@ static void test_GetThreadPreferredUILanguages(void)
ret
=
pGetThreadPreferredUILanguages
(
MUI_LANGUAGE_ID
|
MUI_UI_FALLBACK
,
&
count
,
buf
,
&
size
);
ret
=
pGetThreadPreferredUILanguages
(
MUI_LANGUAGE_ID
|
MUI_UI_FALLBACK
,
&
count
,
buf
,
&
size
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ok
(
count
,
"expected count > 0
\n
"
);
ok
(
count
,
"expected count > 0
\n
"
);
size_id
=
count
=
0
;
ret
=
pGetThreadPreferredUILanguages
(
MUI_LANGUAGE_ID
,
&
count
,
NULL
,
&
size_id
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ok
(
count
,
"expected count > 0
\n
"
);
ok
(
size_id
,
"expected size > 0
\n
"
);
ok
(
size_id
<=
size
,
"expected size > 0
\n
"
);
size
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
pGetThreadPreferredUILanguages
(
MUI_LANGUAGE_ID
,
&
count
,
buf
,
&
size
);
todo_wine
ok
(
!
ret
,
"Expected GetThreadPreferredUILanguages to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
ok
(
size
==
size_id
,
"expected %u, got %u
\n
"
,
size_id
,
size
);
size
=
1
;
SetLastError
(
0xdeadbeef
);
ret
=
pGetThreadPreferredUILanguages
(
MUI_LANGUAGE_ID
,
&
count
,
buf
,
&
size
);
ok
(
!
ret
,
"Expected GetThreadPreferredUILanguages to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
size
==
size_id
,
"expected %u, got %u
\n
"
,
size_id
,
size
);
size
=
size_id
-
1
;
SetLastError
(
0xdeadbeef
);
ret
=
pGetThreadPreferredUILanguages
(
MUI_LANGUAGE_ID
,
&
count
,
buf
,
&
size
);
ok
(
!
ret
,
"Expected GetThreadPreferredUILanguages to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
size
==
size_id
,
"expected %u, got %u
\n
"
,
size_id
,
size
);
size
=
size_id
-
2
;
SetLastError
(
0xdeadbeef
);
ret
=
pGetThreadPreferredUILanguages
(
0
,
&
count
,
buf
,
&
size
);
ok
(
!
ret
,
"Expected GetThreadPreferredUILanguages to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
size
==
size_id
||
size
==
size_id
-
1
/* before win10 1809 */
,
"expected %u, got %u
\n
"
,
size_id
,
size
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
...
...
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