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
c99b874a
Commit
c99b874a
authored
Jan 27, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetcomm/tests: Added a helper for creating stream from string.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0b806667
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
mimeole.c
dlls/inetcomm/tests/mimeole.c
+21
-10
No files found.
dlls/inetcomm/tests/mimeole.c
View file @
c99b874a
...
@@ -82,6 +82,25 @@ static void test_CreateSecurity(void)
...
@@ -82,6 +82,25 @@ static void test_CreateSecurity(void)
IMimeSecurity_Release
(
sec
);
IMimeSecurity_Release
(
sec
);
}
}
static
IStream
*
create_stream_from_string
(
const
char
*
data
)
{
LARGE_INTEGER
off
;
IStream
*
stream
;
HRESULT
hr
;
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IStream_Write
(
stream
,
data
,
strlen
(
data
),
NULL
);
ok
(
hr
==
S_OK
,
"Write failed: %08x
\n
"
,
hr
);
off
.
QuadPart
=
0
;
hr
=
IStream_Seek
(
stream
,
off
,
STREAM_SEEK_SET
,
NULL
);
ok
(
hr
==
S_OK
,
"Seek failed: %08x
\n
"
,
hr
);
return
stream
;
}
static
void
test_CreateBody
(
void
)
static
void
test_CreateBody
(
void
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -103,11 +122,7 @@ static void test_CreateBody(void)
...
@@ -103,11 +122,7 @@ static void test_CreateBody(void)
ok
(
hr
==
MIME_E_NO_DATA
,
"ret %08x
\n
"
,
hr
);
ok
(
hr
==
MIME_E_NO_DATA
,
"ret %08x
\n
"
,
hr
);
ok
(
handle
==
NULL
,
"handle %p
\n
"
,
handle
);
ok
(
handle
==
NULL
,
"handle %p
\n
"
,
handle
);
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
in
);
in
=
create_stream_from_string
(
msg1
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
IStream_Write
(
in
,
msg1
,
sizeof
(
msg1
)
-
1
,
NULL
);
off
.
QuadPart
=
0
;
IStream_Seek
(
in
,
off
,
STREAM_SEEK_SET
,
NULL
);
/* Need to call InitNew before Load otherwise Load crashes with native inetcomm */
/* Need to call InitNew before Load otherwise Load crashes with native inetcomm */
hr
=
IMimeBody_InitNew
(
body
);
hr
=
IMimeBody_InitNew
(
body
);
...
@@ -212,7 +227,6 @@ static void test_CreateMessage(void)
...
@@ -212,7 +227,6 @@ static void test_CreateMessage(void)
HRESULT
hr
;
HRESULT
hr
;
IMimeMessage
*
msg
;
IMimeMessage
*
msg
;
IStream
*
stream
;
IStream
*
stream
;
LARGE_INTEGER
pos
;
LONG
ref
;
LONG
ref
;
HBODY
hbody
,
hbody2
;
HBODY
hbody
,
hbody2
;
IMimeBody
*
body
;
IMimeBody
*
body
;
...
@@ -230,10 +244,7 @@ static void test_CreateMessage(void)
...
@@ -230,10 +244,7 @@ static void test_CreateMessage(void)
hr
=
MimeOleCreateMessage
(
NULL
,
&
msg
);
hr
=
MimeOleCreateMessage
(
NULL
,
&
msg
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
);
stream
=
create_stream_from_string
(
msg1
);
IStream_Write
(
stream
,
msg1
,
sizeof
(
msg1
)
-
1
,
NULL
);
pos
.
QuadPart
=
0
;
IStream_Seek
(
stream
,
pos
,
STREAM_SEEK_SET
,
NULL
);
hr
=
IMimeMessage_Load
(
msg
,
stream
);
hr
=
IMimeMessage_Load
(
msg
,
stream
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
...
...
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