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
f20045c2
Commit
f20045c2
authored
Apr 10, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Add a test for loading an empty picture from a non-statable stream.
parent
39c1c9c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
3 deletions
+53
-3
olepicture.c
dlls/oleaut32/tests/olepicture.c
+53
-3
No files found.
dlls/oleaut32/tests/olepicture.c
View file @
f20045c2
...
...
@@ -1157,7 +1157,8 @@ static void test_load_save_empty_picture(void)
HGLOBAL
hmem
;
DWORD
*
mem
;
IPersistStream
*
src_stream
;
IStream
*
dst_stream
;
IStream
*
dst_stream
,
*
stream
;
LARGE_INTEGER
offset
;
HRESULT
hr
;
memset
(
&
pic
,
0
,
sizeof
(
pic
));
...
...
@@ -1192,10 +1193,59 @@ static void test_load_save_empty_picture(void)
GlobalUnlock
(
hmem
);
IPersistStream_Release
(
src_stream
);
IPicture_Release
(
pic
);
/* first with statable and seekable stream */
offset
.
QuadPart
=
0
;
hr
=
IStream_Seek
(
dst_stream
,
offset
,
SEEK_SET
,
NULL
);
ok
(
hr
==
S_OK
,
"IStream_Seek %#x
\n
"
,
hr
);
pic
=
NULL
;
hr
=
pOleLoadPicture
(
dst_stream
,
0
,
FALSE
,
&
IID_IPicture
,
(
void
**
)
&
pic
);
ok
(
hr
==
S_OK
,
"OleLoadPicture error %#x
\n
"
,
hr
);
ok
(
pic
!=
NULL
,
"picture should not be not NULL
\n
"
);
if
(
pic
!=
NULL
)
{
type
=
-
1
;
hr
=
IPicture_get_Type
(
pic
,
&
type
);
ok
(
hr
==
S_OK
,
"get_Type error %#8x
\n
"
,
hr
);
ok
(
type
==
PICTYPE_NONE
,
"expected picture type PICTYPE_NONE, got %d
\n
"
,
type
);
handle
=
(
OLE_HANDLE
)
0xdeadbeef
;
hr
=
IPicture_get_Handle
(
pic
,
&
handle
);
ok
(
hr
==
S_OK
,
"get_Handle error %#8x
\n
"
,
hr
);
ok
(
!
handle
,
"get_Handle returned wrong handle %#x
\n
"
,
handle
);
IPicture_Release
(
pic
);
}
IStream_Release
(
dst_stream
);
GlobalFree
(
hmem
);
IPicture_Release
(
pic
);
/* again with non-statable and non-seekable stream */
stream
=
NoStatStream_Construct
(
hmem
);
ok
(
stream
!=
NULL
,
"failed to create empty image stream
\n
"
);
pic
=
NULL
;
hr
=
pOleLoadPicture
(
stream
,
0
,
FALSE
,
&
IID_IPicture
,
(
void
**
)
&
pic
);
todo_wine
ok
(
hr
==
S_OK
,
"OleLoadPicture error %#x
\n
"
,
hr
);
todo_wine
ok
(
pic
!=
NULL
,
"picture should not be not NULL
\n
"
);
if
(
pic
!=
NULL
)
{
type
=
-
1
;
hr
=
IPicture_get_Type
(
pic
,
&
type
);
ok
(
hr
==
S_OK
,
"get_Type error %#8x
\n
"
,
hr
);
ok
(
type
==
PICTYPE_NONE
,
"expected picture type PICTYPE_NONE, got %d
\n
"
,
type
);
handle
=
(
OLE_HANDLE
)
0xdeadbeef
;
hr
=
IPicture_get_Handle
(
pic
,
&
handle
);
ok
(
hr
==
S_OK
,
"get_Handle error %#8x
\n
"
,
hr
);
ok
(
!
handle
,
"get_Handle returned wrong handle %#x
\n
"
,
handle
);
IPicture_Release
(
pic
);
}
/* Non-statable impl always deletes on release */
IStream_Release
(
stream
);
}
START_TEST
(
olepicture
)
...
...
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