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
4010876a
Commit
4010876a
authored
Nov 30, 2021
by
Jinoh Kang
Committed by
Alexandre Julliard
Dec 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for EnumCalendarInfo(Ex).
Signed-off-by:
Jinoh Kang
<
jinoh.kang.kr@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2b4d1bd0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
169 additions
and
0 deletions
+169
-0
locale.c
dlls/kernel32/tests/locale.c
+169
-0
No files found.
dlls/kernel32/tests/locale.c
View file @
4010876a
...
...
@@ -7008,6 +7008,171 @@ static void test_geo_name(void)
RegCloseKey
(
key
);
}
static
const
LCID
locales_with_optional_calendars
[]
=
{
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_SAUDI_ARABIA
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_LEBANON
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_EGYPT
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_ALGERIA
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_BAHRAIN
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_IRAQ
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_JORDAN
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_KUWAIT
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_LIBYA
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_MOROCCO
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_OMAN
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_QATAR
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_SYRIA
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_TUNISIA
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_UAE
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_ARABIC
,
SUBLANG_ARABIC_YEMEN
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_CHINESE
,
SUBLANG_CHINESE_TRADITIONAL
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_DIVEHI
,
SUBLANG_DEFAULT
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_PERSIAN
,
SUBLANG_DEFAULT
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_HEBREW
,
SUBLANG_DEFAULT
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_JAPANESE
,
SUBLANG_DEFAULT
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_KOREAN
,
SUBLANG_KOREAN
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_THAI
,
SUBLANG_DEFAULT
),
SORT_DEFAULT
),
MAKELCID
(
MAKELANGID
(
LANG_URDU
,
SUBLANG_URDU_PAKISTAN
),
SORT_DEFAULT
)
};
static
BOOL
CALLBACK
calinfo_procA
(
LPSTR
calinfo
)
{
(
void
)
calinfo
;
return
TRUE
;
}
static
void
test_EnumCalendarInfoA
(
void
)
{
INT
i
;
if
(
!
strcmp
(
winetest_platform
,
"wine"
))
{
skip
(
"EnumCalendarInfo broken on Wine (test would hang with an infinite loop)
\n
"
);
return
;
}
ok
(
EnumCalendarInfoA
(
calinfo_procA
,
LOCALE_USER_DEFAULT
,
ENUM_ALL_CALENDARS
,
CAL_RETURN_NUMBER
|
CAL_ICALINTVALUE
),
"EnumCalendarInfoA for user default locale failed: %u
\n
"
,
GetLastError
()
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
locales_with_optional_calendars
);
i
++
)
{
LCID
lcid
=
locales_with_optional_calendars
[
i
];
ok
(
EnumCalendarInfoA
(
calinfo_procA
,
lcid
,
ENUM_ALL_CALENDARS
,
CAL_RETURN_NUMBER
|
CAL_ICALINTVALUE
)
||
broken
(
GetLastError
()
==
ERROR_INVALID_FLAGS
)
/* no locale */
,
"EnumCalendarInfoA for LCID %#06x failed: %u
\n
"
,
lcid
,
GetLastError
()
);
}
}
static
BOOL
CALLBACK
calinfo_procW
(
LPWSTR
calinfo
)
{
(
void
)
calinfo
;
return
TRUE
;
}
static
void
test_EnumCalendarInfoW
(
void
)
{
INT
i
;
if
(
!
strcmp
(
winetest_platform
,
"wine"
))
{
skip
(
"EnumCalendarInfo broken on Wine (test would hang with an infinite loop)
\n
"
);
return
;
}
ok
(
EnumCalendarInfoW
(
calinfo_procW
,
LOCALE_USER_DEFAULT
,
ENUM_ALL_CALENDARS
,
CAL_RETURN_NUMBER
|
CAL_ICALINTVALUE
),
"EnumCalendarInfoW for user default locale failed: %u
\n
"
,
GetLastError
()
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
locales_with_optional_calendars
);
i
++
)
{
LCID
lcid
=
locales_with_optional_calendars
[
i
];
ok
(
EnumCalendarInfoW
(
calinfo_procW
,
lcid
,
ENUM_ALL_CALENDARS
,
CAL_RETURN_NUMBER
|
CAL_ICALINTVALUE
)
||
broken
(
GetLastError
()
==
ERROR_INVALID_FLAGS
)
/* no locale */
,
"EnumCalendarInfoW for LCID %#06x failed: %u
\n
"
,
lcid
,
GetLastError
()
);
}
}
static
BOOL
CALLBACK
calinfoex_procA
(
LPSTR
calinfo
,
LCID
calid
)
{
(
void
)
calinfo
;
(
void
)
calid
;
return
TRUE
;
}
static
void
test_EnumCalendarInfoExA
(
void
)
{
INT
i
;
if
(
!
strcmp
(
winetest_platform
,
"wine"
))
{
skip
(
"EnumCalendarInfo broken on Wine (test would hang with an infinite loop)
\n
"
);
return
;
}
ok
(
EnumCalendarInfoExA
(
calinfoex_procA
,
LOCALE_USER_DEFAULT
,
ENUM_ALL_CALENDARS
,
CAL_RETURN_NUMBER
|
CAL_ICALINTVALUE
),
"EnumCalendarInfoExA for user default locale failed: %u
\n
"
,
GetLastError
()
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
locales_with_optional_calendars
);
i
++
)
{
LCID
lcid
=
locales_with_optional_calendars
[
i
];
ok
(
EnumCalendarInfoExA
(
calinfoex_procA
,
lcid
,
ENUM_ALL_CALENDARS
,
CAL_RETURN_NUMBER
|
CAL_ICALINTVALUE
)
||
broken
(
GetLastError
()
==
ERROR_INVALID_FLAGS
)
/* no locale */
,
"EnumCalendarInfoExA for LCID %#06x failed: %u
\n
"
,
lcid
,
GetLastError
()
);
}
}
static
BOOL
CALLBACK
calinfoex_procW
(
LPWSTR
calinfo
,
LCID
calid
)
{
(
void
)
calinfo
;
(
void
)
calid
;
return
TRUE
;
}
static
void
test_EnumCalendarInfoExW
(
void
)
{
INT
i
;
if
(
!
strcmp
(
winetest_platform
,
"wine"
))
{
skip
(
"EnumCalendarInfo broken on Wine (test would hang with an infinite loop)
\n
"
);
return
;
}
ok
(
EnumCalendarInfoExW
(
calinfoex_procW
,
LOCALE_USER_DEFAULT
,
ENUM_ALL_CALENDARS
,
CAL_RETURN_NUMBER
|
CAL_ICALINTVALUE
),
"EnumCalendarInfoExW for user default locale failed: %u
\n
"
,
GetLastError
()
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
locales_with_optional_calendars
);
i
++
)
{
LCID
lcid
=
locales_with_optional_calendars
[
i
];
ok
(
EnumCalendarInfoExW
(
calinfoex_procW
,
lcid
,
ENUM_ALL_CALENDARS
,
CAL_RETURN_NUMBER
|
CAL_ICALINTVALUE
)
||
broken
(
GetLastError
()
==
ERROR_INVALID_FLAGS
)
/* no locale */
,
"EnumCalendarInfoExW for LCID %#06x failed: %u
\n
"
,
lcid
,
GetLastError
()
);
}
}
START_TEST
(
locale
)
{
InitFunctionPointers
();
...
...
@@ -7060,4 +7225,8 @@ START_TEST(locale)
test_NLSVersion
();
test_geo_name
();
test_sorting
();
test_EnumCalendarInfoA
();
test_EnumCalendarInfoW
();
test_EnumCalendarInfoExA
();
test_EnumCalendarInfoExW
();
}
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