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
72922cd1
Commit
72922cd1
authored
Aug 26, 2015
by
Daniel Lehman
Committed by
Alexandre Julliard
Aug 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for Invariant.
parent
e5ce90ed
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
185 additions
and
0 deletions
+185
-0
locale.c
dlls/kernel32/tests/locale.c
+185
-0
No files found.
dlls/kernel32/tests/locale.c
View file @
72922cd1
...
...
@@ -4317,6 +4317,190 @@ static void test_EnumSystemGeoID(void)
}
}
struct
invariant_entry
{
const
char
*
name
;
int
id
;
const
char
*
expect
;
};
#define X(x) #x, x
static
const
struct
invariant_entry
invariant_list
[]
=
{
{
X
(
LOCALE_ILANGUAGE
),
"007f"
},
{
X
(
LOCALE_SENGLANGUAGE
),
"Invariant Language"
},
{
X
(
LOCALE_SABBREVLANGNAME
),
"IVL"
},
{
X
(
LOCALE_SNATIVELANGNAME
),
"Invariant Language"
},
{
X
(
LOCALE_ICOUNTRY
),
"1"
},
{
X
(
LOCALE_SENGCOUNTRY
),
"Invariant Country"
},
{
X
(
LOCALE_SABBREVCTRYNAME
),
"IVC"
},
{
X
(
LOCALE_SNATIVECTRYNAME
),
"Invariant Country"
},
{
X
(
LOCALE_IDEFAULTLANGUAGE
),
"0409"
},
{
X
(
LOCALE_IDEFAULTCOUNTRY
),
"1"
},
{
X
(
LOCALE_IDEFAULTCODEPAGE
),
"437"
},
{
X
(
LOCALE_IDEFAULTANSICODEPAGE
),
"1252"
},
{
X
(
LOCALE_IDEFAULTMACCODEPAGE
),
"10000"
},
{
X
(
LOCALE_SLIST
),
","
},
{
X
(
LOCALE_IMEASURE
),
"0"
},
{
X
(
LOCALE_SDECIMAL
),
"."
},
{
X
(
LOCALE_STHOUSAND
),
","
},
{
X
(
LOCALE_SGROUPING
),
"3;0"
},
{
X
(
LOCALE_IDIGITS
),
"2"
},
{
X
(
LOCALE_ILZERO
),
"1"
},
{
X
(
LOCALE_INEGNUMBER
),
"1"
},
{
X
(
LOCALE_SNATIVEDIGITS
),
"0123456789"
},
{
X
(
LOCALE_SCURRENCY
),
"
\x00a4
"
},
{
X
(
LOCALE_SINTLSYMBOL
),
"XDR"
},
{
X
(
LOCALE_SMONDECIMALSEP
),
"."
},
{
X
(
LOCALE_SMONTHOUSANDSEP
),
","
},
{
X
(
LOCALE_SMONGROUPING
),
"3;0"
},
{
X
(
LOCALE_ICURRDIGITS
),
"2"
},
{
X
(
LOCALE_IINTLCURRDIGITS
),
"2"
},
{
X
(
LOCALE_ICURRENCY
),
"0"
},
{
X
(
LOCALE_INEGCURR
),
"0"
},
{
X
(
LOCALE_SDATE
),
"/"
},
{
X
(
LOCALE_STIME
),
":"
},
{
X
(
LOCALE_SSHORTDATE
),
"MM/dd/yyyy"
},
{
X
(
LOCALE_SLONGDATE
),
"dddd, dd MMMM yyyy"
},
{
X
(
LOCALE_STIMEFORMAT
),
"HH:mm:ss"
},
{
X
(
LOCALE_IDATE
),
"0"
},
{
X
(
LOCALE_ILDATE
),
"1"
},
{
X
(
LOCALE_ITIME
),
"1"
},
{
X
(
LOCALE_ITIMEMARKPOSN
),
"0"
},
{
X
(
LOCALE_ICENTURY
),
"1"
},
{
X
(
LOCALE_ITLZERO
),
"1"
},
{
X
(
LOCALE_IDAYLZERO
),
"1"
},
{
X
(
LOCALE_IMONLZERO
),
"1"
},
{
X
(
LOCALE_S1159
),
"AM"
},
{
X
(
LOCALE_S2359
),
"PM"
},
{
X
(
LOCALE_ICALENDARTYPE
),
"1"
},
{
X
(
LOCALE_IOPTIONALCALENDAR
),
"0"
},
{
X
(
LOCALE_IFIRSTDAYOFWEEK
),
"6"
},
{
X
(
LOCALE_IFIRSTWEEKOFYEAR
),
"0"
},
{
X
(
LOCALE_SDAYNAME1
),
"Monday"
},
{
X
(
LOCALE_SDAYNAME2
),
"Tuesday"
},
{
X
(
LOCALE_SDAYNAME3
),
"Wednesday"
},
{
X
(
LOCALE_SDAYNAME4
),
"Thursday"
},
{
X
(
LOCALE_SDAYNAME5
),
"Friday"
},
{
X
(
LOCALE_SDAYNAME6
),
"Saturday"
},
{
X
(
LOCALE_SDAYNAME7
),
"Sunday"
},
{
X
(
LOCALE_SABBREVDAYNAME1
),
"Mon"
},
{
X
(
LOCALE_SABBREVDAYNAME2
),
"Tue"
},
{
X
(
LOCALE_SABBREVDAYNAME3
),
"Wed"
},
{
X
(
LOCALE_SABBREVDAYNAME4
),
"Thu"
},
{
X
(
LOCALE_SABBREVDAYNAME5
),
"Fri"
},
{
X
(
LOCALE_SABBREVDAYNAME6
),
"Sat"
},
{
X
(
LOCALE_SABBREVDAYNAME7
),
"Sun"
},
{
X
(
LOCALE_SMONTHNAME1
),
"January"
},
{
X
(
LOCALE_SMONTHNAME2
),
"February"
},
{
X
(
LOCALE_SMONTHNAME3
),
"March"
},
{
X
(
LOCALE_SMONTHNAME4
),
"April"
},
{
X
(
LOCALE_SMONTHNAME5
),
"May"
},
{
X
(
LOCALE_SMONTHNAME6
),
"June"
},
{
X
(
LOCALE_SMONTHNAME7
),
"July"
},
{
X
(
LOCALE_SMONTHNAME8
),
"August"
},
{
X
(
LOCALE_SMONTHNAME9
),
"September"
},
{
X
(
LOCALE_SMONTHNAME10
),
"October"
},
{
X
(
LOCALE_SMONTHNAME11
),
"November"
},
{
X
(
LOCALE_SMONTHNAME12
),
"December"
},
{
X
(
LOCALE_SMONTHNAME13
),
""
},
{
X
(
LOCALE_SABBREVMONTHNAME1
),
"Jan"
},
{
X
(
LOCALE_SABBREVMONTHNAME2
),
"Feb"
},
{
X
(
LOCALE_SABBREVMONTHNAME3
),
"Mar"
},
{
X
(
LOCALE_SABBREVMONTHNAME4
),
"Apr"
},
{
X
(
LOCALE_SABBREVMONTHNAME5
),
"May"
},
{
X
(
LOCALE_SABBREVMONTHNAME6
),
"Jun"
},
{
X
(
LOCALE_SABBREVMONTHNAME7
),
"Jul"
},
{
X
(
LOCALE_SABBREVMONTHNAME8
),
"Aug"
},
{
X
(
LOCALE_SABBREVMONTHNAME9
),
"Sep"
},
{
X
(
LOCALE_SABBREVMONTHNAME10
),
"Oct"
},
{
X
(
LOCALE_SABBREVMONTHNAME11
),
"Nov"
},
{
X
(
LOCALE_SABBREVMONTHNAME12
),
"Dec"
},
{
X
(
LOCALE_SABBREVMONTHNAME13
),
""
},
{
X
(
LOCALE_SPOSITIVESIGN
),
"+"
},
{
X
(
LOCALE_SNEGATIVESIGN
),
"-"
},
{
X
(
LOCALE_IPOSSIGNPOSN
),
"3"
},
{
X
(
LOCALE_INEGSIGNPOSN
),
"0"
},
{
X
(
LOCALE_IPOSSYMPRECEDES
),
"1"
},
{
X
(
LOCALE_IPOSSEPBYSPACE
),
"0"
},
{
X
(
LOCALE_INEGSYMPRECEDES
),
"1"
},
{
X
(
LOCALE_INEGSEPBYSPACE
),
"0"
},
{
X
(
LOCALE_SISO639LANGNAME
),
"iv"
},
{
X
(
LOCALE_SISO3166CTRYNAME
),
"IV"
},
{
X
(
LOCALE_IDEFAULTEBCDICCODEPAGE
),
"037"
},
{
X
(
LOCALE_IPAPERSIZE
),
"9"
},
{
X
(
LOCALE_SENGCURRNAME
),
"International Monetary Fund"
},
{
X
(
LOCALE_SNATIVECURRNAME
),
"International Monetary Fund"
},
{
X
(
LOCALE_SYEARMONTH
),
"yyyy MMMM"
},
{
X
(
LOCALE_IDIGITSUBSTITUTION
),
"1"
},
{
X
(
LOCALE_SNAME
),
""
},
{
X
(
LOCALE_SSCRIPTS
),
"Latn;"
},
{
0
}
};
#undef X
static
void
test_invariant
(
void
)
{
int
ret
;
int
len
;
char
buffer
[
BUFFER_SIZE
];
const
struct
invariant_entry
*
ptr
=
invariant_list
;
if
(
!
GetLocaleInfoA
(
LOCALE_INVARIANT
,
NUO
|
LOCALE_SLANGUAGE
,
buffer
,
sizeof
(
buffer
)))
{
win_skip
(
"GetLocaleInfoA(LOCALE_INVARIANT) not supported
\n
"
);
/* win2k */
return
;
}
while
(
ptr
->
name
)
{
ret
=
GetLocaleInfoA
(
LOCALE_INVARIANT
,
NUO
|
ptr
->
id
,
buffer
,
sizeof
(
buffer
));
if
(
!
ret
&&
(
ptr
->
id
==
LOCALE_SNAME
||
ptr
->
id
==
LOCALE_SSCRIPTS
))
win_skip
(
"not supported
\n
"
);
/* winxp/win2k3 */
else
{
len
=
strlen
(
ptr
->
expect
)
+
1
;
/* include \0 */
ok
(
ret
==
len
,
"For id %d, expected ret == %d, got %d, error %d
\n
"
,
ptr
->
id
,
len
,
ret
,
GetLastError
());
ok
(
!
strcmp
(
buffer
,
ptr
->
expect
),
"For id %d, Expected %s, got '%s'
\n
"
,
ptr
->
id
,
ptr
->
expect
,
buffer
);
}
ptr
++
;
}
if
((
PRIMARYLANGID
(
LANGIDFROMLCID
(
GetSystemDefaultLCID
()))
!=
LANG_ENGLISH
)
||
(
PRIMARYLANGID
(
LANGIDFROMLCID
(
GetThreadLocale
()))
!=
LANG_ENGLISH
))
{
skip
(
"Non-English locale
\n
"
);
}
else
{
/* some locales translate these */
static
const
char
lang
[]
=
"Invariant Language (Invariant Country)"
;
static
const
char
cntry
[]
=
"Invariant Country"
;
static
const
char
sortm
[]
=
"Math Alphanumerics"
;
static
const
char
sortd
[]
=
"Default"
;
/* win2k3 */
ret
=
GetLocaleInfoA
(
LOCALE_INVARIANT
,
NUO
|
LOCALE_SLANGUAGE
,
buffer
,
sizeof
(
buffer
));
len
=
lstrlenA
(
lang
)
+
1
;
ok
(
ret
==
len
,
"Expected ret == %d, got %d, error %d
\n
"
,
len
,
ret
,
GetLastError
());
ok
(
!
strcmp
(
buffer
,
lang
),
"Expected %s, got '%s'
\n
"
,
lang
,
buffer
);
ret
=
GetLocaleInfoA
(
LOCALE_INVARIANT
,
NUO
|
LOCALE_SCOUNTRY
,
buffer
,
sizeof
(
buffer
));
len
=
lstrlenA
(
cntry
)
+
1
;
ok
(
ret
==
len
,
"Expected ret == %d, got %d, error %d
\n
"
,
len
,
ret
,
GetLastError
());
ok
(
!
strcmp
(
buffer
,
cntry
),
"Expected %s, got '%s'
\n
"
,
cntry
,
buffer
);
ret
=
GetLocaleInfoA
(
LOCALE_INVARIANT
,
NUO
|
LOCALE_SSORTNAME
,
buffer
,
sizeof
(
buffer
));
if
(
ret
==
lstrlenA
(
sortm
)
+
1
)
ok
(
!
strcmp
(
buffer
,
sortm
),
"Expected %s, got '%s'
\n
"
,
sortm
,
buffer
);
else
if
(
ret
==
lstrlenA
(
sortd
)
+
1
)
/* win2k3 */
ok
(
!
strcmp
(
buffer
,
sortd
),
"Expected %s, got '%s'
\n
"
,
sortd
,
buffer
);
else
ok
(
0
,
"Expected ret == %d or %d, got %d, error %d
\n
"
,
lstrlenA
(
sortm
)
+
1
,
lstrlenA
(
sortd
)
+
1
,
ret
,
GetLastError
());
}
}
START_TEST
(
locale
)
{
InitFunctionPointers
();
...
...
@@ -4356,6 +4540,7 @@ START_TEST(locale)
test_CompareStringOrdinal
();
test_GetGeoInfo
();
test_EnumSystemGeoID
();
test_invariant
();
/* this requires collation table patch to make it MS compatible */
if
(
0
)
test_sorting
();
}
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