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
3fe7ea12
Commit
3fe7ea12
authored
Sep 10, 2008
by
Huw Davies
Committed by
Alexandre Julliard
Sep 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetcomm/tests: Add tests for IMimeInternational_GetCodePageCharset.
parent
f3a6b7a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
mimeintl.c
dlls/inetcomm/tests/mimeintl.c
+59
-0
No files found.
dlls/inetcomm/tests/mimeintl.c
View file @
3fe7ea12
...
...
@@ -82,6 +82,53 @@ static HRESULT mlang_getcsetinfo(const char *charset, MIMECSETINFO *mlang_info)
return
hr
;
}
static
HRESULT
mlang_getcodepageinfo
(
UINT
cp
,
MIMECPINFO
*
mlang_cp_info
)
{
HRESULT
hr
;
IMultiLanguage
*
ml
;
hr
=
get_mlang
(
&
ml
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IMultiLanguage_GetCodePageInfo
(
ml
,
cp
,
mlang_cp_info
);
IMultiLanguage_Release
(
ml
);
}
return
hr
;
}
static
HRESULT
mlang_getcsetinfo_from_cp
(
UINT
cp
,
CHARSETTYPE
charset_type
,
MIMECSETINFO
*
mlang_info
)
{
MIMECPINFO
mlang_cp_info
;
WCHAR
*
charset_name
;
HRESULT
hr
;
IMultiLanguage
*
ml
;
hr
=
mlang_getcodepageinfo
(
cp
,
&
mlang_cp_info
);
if
(
FAILED
(
hr
))
return
hr
;
switch
(
charset_type
)
{
case
CHARSET_BODY
:
charset_name
=
mlang_cp_info
.
wszBodyCharset
;
break
;
case
CHARSET_HEADER
:
charset_name
=
mlang_cp_info
.
wszHeaderCharset
;
break
;
case
CHARSET_WEB
:
charset_name
=
mlang_cp_info
.
wszWebCharset
;
break
;
}
hr
=
get_mlang
(
&
ml
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IMultiLanguage_GetCharsetInfo
(
ml
,
charset_name
,
mlang_info
);
IMultiLanguage_Release
(
ml
);
}
return
hr
;
}
static
void
test_charset
(
void
)
{
...
...
@@ -119,6 +166,18 @@ static void test_charset(void)
ok
(
cs_info
.
hCharset
==
hcs_windows_1252
,
"hCharset doesn't match requested
\n
"
);
ok
(
!
strcmp
(
cs_info
.
szName
,
"windows-1252"
),
"szName doesn't match requested
\n
"
);
hr
=
IMimeInternational_GetCodePageCharset
(
internat
,
1252
,
CHARSET_BODY
,
&
hcs
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IMimeInternational_GetCharsetInfo
(
internat
,
hcs
,
&
cs_info
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
mlang_getcsetinfo_from_cp
(
1252
,
CHARSET_BODY
,
&
mlang_cs_info
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
cs_info
.
cpiWindows
==
mlang_cs_info
.
uiCodePage
,
"cpiWindows %d while mlang uiCodePage %d
\n
"
,
cs_info
.
cpiWindows
,
mlang_cs_info
.
uiCodePage
);
ok
(
cs_info
.
cpiInternet
==
mlang_cs_info
.
uiInternetEncoding
,
"cpiInternet %d while mlang uiInternetEncoding %d
\n
"
,
cs_info
.
cpiInternet
,
mlang_cs_info
.
uiInternetEncoding
);
IMimeInternational_Release
(
internat
);
}
...
...
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