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
30aea19e
Commit
30aea19e
authored
Apr 30, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Added IdnToUnicode tests.
parent
e2f04639
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
1 deletion
+81
-1
locale.c
dlls/kernel32/tests/locale.c
+81
-1
No files found.
dlls/kernel32/tests/locale.c
View file @
30aea19e
...
...
@@ -78,6 +78,7 @@ static INT (WINAPI *pFoldStringW)(DWORD, LPCWSTR, INT, LPWSTR, INT);
static
BOOL
(
WINAPI
*
pIsValidLanguageGroup
)(
LGRPID
,
DWORD
);
static
INT
(
WINAPI
*
pIdnToNameprepUnicode
)(
DWORD
,
LPCWSTR
,
INT
,
LPWSTR
,
INT
);
static
INT
(
WINAPI
*
pIdnToAscii
)(
DWORD
,
LPCWSTR
,
INT
,
LPWSTR
,
INT
);
static
INT
(
WINAPI
*
pIdnToUnicode
)(
DWORD
,
LPCWSTR
,
INT
,
LPWSTR
,
INT
);
static
void
InitFunctionPointers
(
void
)
{
...
...
@@ -93,6 +94,7 @@ static void InitFunctionPointers(void)
pEnumSystemLocalesEx
=
(
void
*
)
GetProcAddress
(
hKernel32
,
"EnumSystemLocalesEx"
);
pIdnToNameprepUnicode
=
(
void
*
)
GetProcAddress
(
hKernel32
,
"IdnToNameprepUnicode"
);
pIdnToAscii
=
(
void
*
)
GetProcAddress
(
hKernel32
,
"IdnToAscii"
);
pIdnToUnicode
=
(
void
*
)
GetProcAddress
(
hKernel32
,
"IdnToUnicode"
);
}
#define eq(received, expected, label, type) \
...
...
@@ -3033,7 +3035,12 @@ static void test_IdnToAscii(void)
35
,
{
'x'
,
'n'
,
'-'
,
'-'
,
'b'
,
'e'
,
'a'
,
'2'
,
'a'
,
'1'
,
'6'
,
'3'
,
'1'
,
'a'
,
'v'
,
'b'
,
'a'
,
'v'
,
'4'
,
'4'
,
't'
,
'y'
,
'h'
,
'a'
,
'3'
,
'2'
,
'b'
,
'9'
,
'1'
,
'e'
,
'g'
,
's'
,
'2'
,
't'
,
0
},
0
,
0xdeadbeef
}
},
{
2
,
{
0x221
,
0
},
8
,
{
'x'
,
'n'
,
'-'
,
'-'
,
'6'
,
'l'
,
'a'
,
0
},
IDN_ALLOW_UNASSIGNED
,
0xdeadbeef
},
};
WCHAR
buf
[
1024
];
...
...
@@ -3058,6 +3065,78 @@ static void test_IdnToAscii(void)
}
}
static
void
test_IdnToUnicode
(
void
)
{
struct
{
DWORD
in_len
;
const
WCHAR
in
[
64
];
DWORD
ret
;
const
WCHAR
out
[
64
];
DWORD
flags
;
DWORD
err
;
}
test_data
[]
=
{
{
5
,
{
'T'
,
'e'
,
's'
,
'.'
,
0
},
5
,
{
'T'
,
'e'
,
's'
,
'.'
,
0
},
0
,
0xdeadbeef
},
{
2
,
{
0x105
,
0
},
0
,
{
0
},
0
,
ERROR_INVALID_NAME
},
{
33
,
{
'x'
,
'n'
,
'-'
,
'-'
,
'4'
,
'd'
,
'b'
,
'c'
,
'a'
,
'g'
,
'd'
,
'a'
,
'h'
,
'y'
,
'm'
,
'b'
,
'x'
,
'e'
,
'k'
,
'h'
,
'e'
,
'h'
,
'6'
,
'e'
,
'0'
,
'a'
,
'7'
,
'f'
,
'e'
,
'i'
,
'0'
,
'b'
,
0
},
23
,
{
0x05dc
,
0x05de
,
0x05d4
,
0x05d4
,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R
buf
[
1024
];
DWORD
i
,
ret
,
err
;
if
(
!
pIdnToUnicode
)
{
win_skip
(
"IdnToUnicode is not available
\n
"
);
return
;
}
for
(
i
=
0
;
i
<
sizeof
(
test_data
)
/
sizeof
(
*
test_data
);
i
++
)
{
SetLastError
(
0xdeadbeef
);
ret
=
pIdnToUnicode
(
test_data
[
i
].
flags
,
test_data
[
i
].
in
,
test_data
[
i
].
in_len
,
buf
,
sizeof
(
buf
));
err
=
GetLastError
();
ok
(
ret
==
test_data
[
i
].
ret
,
"%d) ret = %d
\n
"
,
i
,
ret
);
ok
(
err
==
test_data
[
i
].
err
,
"%d) err = %d
\n
"
,
i
,
err
);
ok
(
!
memcmp
(
test_data
[
i
].
out
,
buf
,
ret
*
sizeof
(
WCHAR
)),
"%d) buf = %s
\n
"
,
i
,
wine_dbgstr_wn
(
buf
,
ret
));
}
}
START_TEST
(
locale
)
{
InitFunctionPointers
();
...
...
@@ -3087,6 +3166,7 @@ START_TEST(locale)
test_GetStringTypeW
();
test_IdnToNameprepUnicode
();
test_IdnToAscii
();
test_IdnToUnicode
();
/* 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