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
3dd46c36
Commit
3dd46c36
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_GetCharsetInfo.
parent
12bb6e48
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
2 deletions
+46
-2
Makefile.in
dlls/inetcomm/tests/Makefile.in
+1
-1
mimeintl.c
dlls/inetcomm/tests/mimeintl.c
+45
-0
mimeole.c
dlls/inetcomm/tests/mimeole.c
+0
-1
No files found.
dlls/inetcomm/tests/Makefile.in
View file @
3dd46c36
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
inetcomm.dll
IMPORTS
=
inetcomm ole32 kernel32
IMPORTS
=
inetcomm ole
aut32 ole
32 kernel32
CTESTS
=
\
mimeintl.c
\
...
...
dlls/inetcomm/tests/mimeintl.c
View file @
3dd46c36
...
...
@@ -27,6 +27,9 @@
#include "mimeole.h"
#include "initguid.h"
#include "mlang.h"
#include <stdio.h>
#include <assert.h>
...
...
@@ -52,11 +55,41 @@ static void test_create(void)
IMimeInternational_Release
(
internat
);
}
static
inline
HRESULT
get_mlang
(
IMultiLanguage
**
ml
)
{
return
CoCreateInstance
(
&
CLSID_CMultiLanguage
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IMultiLanguage
,
(
void
**
)
ml
);
}
static
HRESULT
mlang_getcsetinfo
(
const
char
*
charset
,
MIMECSETINFO
*
mlang_info
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
charset
,
-
1
,
NULL
,
0
);
BSTR
bstr
=
SysAllocStringLen
(
NULL
,
len
-
1
);
HRESULT
hr
;
IMultiLanguage
*
ml
;
MultiByteToWideChar
(
CP_ACP
,
0
,
charset
,
-
1
,
bstr
,
len
);
hr
=
get_mlang
(
&
ml
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IMultiLanguage_GetCharsetInfo
(
ml
,
bstr
,
mlang_info
);
IMultiLanguage_Release
(
ml
);
}
SysFreeString
(
bstr
);
if
(
FAILED
(
hr
))
hr
=
MIME_E_NOT_FOUND
;
return
hr
;
}
static
void
test_charset
(
void
)
{
IMimeInternational
*
internat
;
HRESULT
hr
;
HCHARSET
hcs
,
hcs_windows_1252
,
hcs_windows_1251
;
INETCSETINFO
cs_info
;
MIMECSETINFO
mlang_cs_info
;
hr
=
MimeOleGetInternat
(
&
internat
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
...
...
@@ -74,6 +107,18 @@ static void test_charset(void)
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hcs_windows_1252
!=
hcs_windows_1251
,
"got the same hcharset for the different names
\n
"
);
hr
=
IMimeInternational_GetCharsetInfo
(
internat
,
hcs_windows_1252
,
&
cs_info
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
mlang_getcsetinfo
(
"windows-1252"
,
&
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
);
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
"
);
IMimeInternational_Release
(
internat
);
}
...
...
dlls/inetcomm/tests/mimeole.c
View file @
3dd46c36
...
...
@@ -26,7 +26,6 @@
#include "ole2.h"
#include "ocidl.h"
#include "initguid.h"
#include "mimeole.h"
#include <stdio.h>
...
...
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