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
fd0d17ec
Commit
fd0d17ec
authored
Jun 01, 2009
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jun 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for GetLocaleInfo with SUBLANG_NEUTRAL.
parent
43d982fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
3 deletions
+41
-3
locale.c
dlls/kernel32/tests/locale.c
+41
-3
No files found.
dlls/kernel32/tests/locale.c
View file @
fd0d17ec
...
...
@@ -120,23 +120,61 @@ static void test_GetLocaleInfoA(void)
int
ret
;
LCID
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
SORT_DEFAULT
);
char
buffer
[
BUFFER_SIZE
];
const
char
*
expected
;
ok
(
lcid
==
0x409
,
"wrong LCID calculated - %d
\n
"
,
lcid
);
/* en, ar and zh use SUBLANG_NEUTRAL, but GetLocaleInfo assume SUBLANG_DEFAULT */
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
);
/* SUBLANG_DEFAULT is not required for GetLocaleInfo */
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
);
/* HTMLKit and "Font xplorer lite" expect GetLocaleInfoA to
* partially fill the buffer even if it is too short. See bug 637.
*/
SetLastError
(
0
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
SetLastError
(
0xdeadbeef
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
ret
=
GetLocaleInfoA
(
lcid
,
NUO
|
LOCALE_SDAYNAME1
,
buffer
,
0
);
ok
(
ret
==
7
&&
!
buffer
[
0
],
"Expected len=7, got %d
\n
"
,
ret
);
SetLastError
(
0
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
SetLastError
(
0xdeadbeef
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
ret
=
GetLocaleInfoA
(
lcid
,
NUO
|
LOCALE_SDAYNAME1
,
buffer
,
3
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
ok
(
!
strcmp
(
buffer
,
"Mon"
),
"Expected 'Mon', got '%s'
\n
"
,
buffer
);
SetLastError
(
0
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
SetLastError
(
0xdeadbeef
);
memset
(
buffer
,
0
,
COUNTOF
(
buffer
));
ret
=
GetLocaleInfoA
(
lcid
,
NUO
|
LOCALE_SDAYNAME1
,
buffer
,
10
);
ok
(
ret
==
7
,
"Expected ret == 7, got %d, error %d
\n
"
,
ret
,
GetLastError
());
ok
(
!
strcmp
(
buffer
,
"Monday"
),
"Expected 'Monday', got '%s'
\n
"
,
buffer
);
...
...
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