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
8873d90f
Commit
8873d90f
authored
Jul 27, 2005
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jul 27, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Reimplement EnumDateFormats, make it work for all available
locales. - Add a test for EnumDateFormats.
parent
e5503f96
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
250 deletions
+130
-250
lcformat.c
dlls/kernel/lcformat.c
+58
-250
locale.c
dlls/kernel/tests/locale.c
+72
-0
No files found.
dlls/kernel/lcformat.c
View file @
8873d90f
This diff is collapsed.
Click to expand it.
dlls/kernel/tests/locale.c
View file @
8873d90f
...
...
@@ -2094,11 +2094,83 @@ static void test_EnumUILanguageA(void)
EXPECT_FALSE
;
EXPECT_INVALID
;
}
static
char
date_fmt_buf
[
1024
];
static
BOOL
CALLBACK
enum_datefmt_procA
(
LPSTR
fmt
)
{
lstrcatA
(
date_fmt_buf
,
fmt
);
lstrcatA
(
date_fmt_buf
,
"
\n
"
);
return
TRUE
;
}
static
void
test_EnumDateFormatsA
(
void
)
{
char
*
p
,
buf
[
256
];
BOOL
ret
;
LCID
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
SORT_DEFAULT
);
trace
(
"EnumDateFormatsA 0
\n
"
);
date_fmt_buf
[
0
]
=
0
;
ret
=
EnumDateFormatsA
(
enum_datefmt_procA
,
lcid
,
0
);
ok
(
ret
,
"EnumDateFormatsA(0) error %ld
\n
"
,
GetLastError
());
trace
(
"%s
\n
"
,
date_fmt_buf
);
/* test the 1st enumerated format */
if
((
p
=
strchr
(
date_fmt_buf
,
'\n'
)))
*
p
=
0
;
ret
=
GetLocaleInfoA
(
lcid
,
LOCALE_SSHORTDATE
,
buf
,
sizeof
(
buf
));
ok
(
ret
,
"GetLocaleInfoA(LOCALE_SSHORTDATE) error %ld
\n
"
,
GetLastError
());
ok
(
!
lstrcmpA
(
date_fmt_buf
,
buf
),
"expected
\"
%s
\"
got
\"
%s
\"\n
"
,
date_fmt_buf
,
buf
);
trace
(
"EnumDateFormatsA LOCALE_USE_CP_ACP
\n
"
);
date_fmt_buf
[
0
]
=
0
;
ret
=
EnumDateFormatsA
(
enum_datefmt_procA
,
lcid
,
LOCALE_USE_CP_ACP
);
ok
(
ret
,
"EnumDateFormatsA(LOCALE_USE_CP_ACP) error %ld
\n
"
,
GetLastError
());
trace
(
"%s
\n
"
,
date_fmt_buf
);
/* test the 1st enumerated format */
if
((
p
=
strchr
(
date_fmt_buf
,
'\n'
)))
*
p
=
0
;
ret
=
GetLocaleInfoA
(
lcid
,
LOCALE_SSHORTDATE
,
buf
,
sizeof
(
buf
));
ok
(
ret
,
"GetLocaleInfoA(LOCALE_SSHORTDATE) error %ld
\n
"
,
GetLastError
());
ok
(
!
lstrcmpA
(
date_fmt_buf
,
buf
),
"expected
\"
%s
\"
got
\"
%s
\"\n
"
,
date_fmt_buf
,
buf
);
trace
(
"EnumDateFormatsA DATE_SHORTDATE
\n
"
);
date_fmt_buf
[
0
]
=
0
;
ret
=
EnumDateFormatsA
(
enum_datefmt_procA
,
lcid
,
DATE_SHORTDATE
);
ok
(
ret
,
"EnumDateFormatsA(DATE_SHORTDATE) error %ld
\n
"
,
GetLastError
());
trace
(
"%s
\n
"
,
date_fmt_buf
);
/* test the 1st enumerated format */
if
((
p
=
strchr
(
date_fmt_buf
,
'\n'
)))
*
p
=
0
;
ret
=
GetLocaleInfoA
(
lcid
,
LOCALE_SSHORTDATE
,
buf
,
sizeof
(
buf
));
ok
(
ret
,
"GetLocaleInfoA(LOCALE_SSHORTDATE) error %ld
\n
"
,
GetLastError
());
ok
(
!
lstrcmpA
(
date_fmt_buf
,
buf
),
"expected
\"
%s
\"
got
\"
%s
\"\n
"
,
date_fmt_buf
,
buf
);
trace
(
"EnumDateFormatsA DATE_LONGDATE
\n
"
);
date_fmt_buf
[
0
]
=
0
;
ret
=
EnumDateFormatsA
(
enum_datefmt_procA
,
lcid
,
DATE_LONGDATE
);
ok
(
ret
,
"EnumDateFormatsA(DATE_LONGDATE) error %ld
\n
"
,
GetLastError
());
trace
(
"%s
\n
"
,
date_fmt_buf
);
/* test the 1st enumerated format */
if
((
p
=
strchr
(
date_fmt_buf
,
'\n'
)))
*
p
=
0
;
ret
=
GetLocaleInfoA
(
lcid
,
LOCALE_SLONGDATE
,
buf
,
sizeof
(
buf
));
ok
(
ret
,
"GetLocaleInfoA(LOCALE_SLONGDATE) error %ld
\n
"
,
GetLastError
());
ok
(
!
lstrcmpA
(
date_fmt_buf
,
buf
),
"expected
\"
%s
\"
got
\"
%s
\"\n
"
,
date_fmt_buf
,
buf
);
trace
(
"EnumDateFormatsA DATE_YEARMONTH
\n
"
);
date_fmt_buf
[
0
]
=
0
;
ret
=
EnumDateFormatsA
(
enum_datefmt_procA
,
lcid
,
DATE_YEARMONTH
);
ok
(
ret
,
"EnumDateFormatsA(DATE_YEARMONTH) error %ld
\n
"
,
GetLastError
());
trace
(
"%s
\n
"
,
date_fmt_buf
);
/* test the 1st enumerated format */
if
((
p
=
strchr
(
date_fmt_buf
,
'\n'
)))
*
p
=
0
;
ret
=
GetLocaleInfoA
(
lcid
,
LOCALE_SYEARMONTH
,
buf
,
sizeof
(
buf
));
ok
(
ret
,
"GetLocaleInfoA(LOCALE_SYEARMONTH) error %ld
\n
"
,
GetLastError
());
ok
(
!
lstrcmpA
(
date_fmt_buf
,
buf
),
"expected
\"
%s
\"
got
\"
%s
\"\n
"
,
date_fmt_buf
,
buf
);
}
START_TEST
(
locale
)
{
InitFunctionPointers
();
if
(
0
)
test_EnumTimeFormats
();
test_EnumDateFormatsA
();
test_GetLocaleInfoA
();
test_GetTimeFormatA
();
...
...
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