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
b2de6948
Commit
b2de6948
authored
Nov 24, 2015
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Add some tests for IPicture::SaveAsFile.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0636a700
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
1 deletion
+60
-1
olepicture.c
dlls/oleaut32/tests/olepicture.c
+60
-1
No files found.
dlls/oleaut32/tests/olepicture.c
View file @
b2de6948
...
...
@@ -1052,7 +1052,9 @@ static void test_load_save_bmp(void)
DWORD
*
mem
;
IPersistStream
*
src_stream
;
IStream
*
dst_stream
;
LARGE_INTEGER
offset
;
HRESULT
hr
;
LONG
size
;
desc
.
cbSizeofstruct
=
sizeof
(
desc
);
desc
.
picType
=
PICTYPE_BITMAP
;
...
...
@@ -1074,6 +1076,27 @@ static void test_load_save_bmp(void)
hr
=
CreateStreamOnHGlobal
(
hmem
,
FALSE
,
&
dst_stream
);
ok
(
hr
==
S_OK
,
"createstreamonhglobal error %#x
\n
"
,
hr
);
size
=
-
1
;
hr
=
IPicture_SaveAsFile
(
pic
,
dst_stream
,
TRUE
,
&
size
);
ok
(
hr
==
S_OK
,
"IPicture_SaveasFile error %#x
\n
"
,
hr
);
todo_wine
ok
(
size
==
66
,
"expected 66, got %d
\n
"
,
size
);
mem
=
GlobalLock
(
hmem
);
todo_wine
ok
(
!
memcmp
(
&
mem
[
0
],
"BM"
,
2
),
"got wrong bmp header %04x
\n
"
,
mem
[
0
]);
GlobalUnlock
(
hmem
);
size
=
-
1
;
hr
=
IPicture_SaveAsFile
(
pic
,
dst_stream
,
FALSE
,
&
size
);
todo_wine
ok
(
hr
==
E_FAIL
,
"expected E_FAIL, got %#x
\n
"
,
hr
);
todo_wine
ok
(
size
==
-
1
,
"expected -1, got %d
\n
"
,
size
);
offset
.
QuadPart
=
0
;
hr
=
IStream_Seek
(
dst_stream
,
offset
,
SEEK_SET
,
NULL
);
ok
(
hr
==
S_OK
,
"IStream_Seek %#x
\n
"
,
hr
);
hr
=
IPicture_QueryInterface
(
pic
,
&
IID_IPersistStream
,
(
void
**
)
&
src_stream
);
ok
(
hr
==
S_OK
,
"QueryInterface error %#x
\n
"
,
hr
);
...
...
@@ -1105,7 +1128,9 @@ static void test_load_save_icon(void)
DWORD
*
mem
;
IPersistStream
*
src_stream
;
IStream
*
dst_stream
;
LARGE_INTEGER
offset
;
HRESULT
hr
;
LONG
size
;
desc
.
cbSizeofstruct
=
sizeof
(
desc
);
desc
.
picType
=
PICTYPE_ICON
;
...
...
@@ -1126,6 +1151,27 @@ static void test_load_save_icon(void)
hr
=
CreateStreamOnHGlobal
(
hmem
,
FALSE
,
&
dst_stream
);
ok
(
hr
==
S_OK
,
"CreateStreamOnHGlobal error %#x
\n
"
,
hr
);
size
=
-
1
;
hr
=
IPicture_SaveAsFile
(
pic
,
dst_stream
,
TRUE
,
&
size
);
ok
(
hr
==
S_OK
,
"IPicture_SaveasFile error %#x
\n
"
,
hr
);
todo_wine
ok
(
size
==
766
,
"expected 766, got %d
\n
"
,
size
);
mem
=
GlobalLock
(
hmem
);
todo_wine
ok
(
mem
[
0
]
==
0x00010000
,
"got wrong icon header %04x
\n
"
,
mem
[
0
]);
GlobalUnlock
(
hmem
);
size
=
-
1
;
hr
=
IPicture_SaveAsFile
(
pic
,
dst_stream
,
FALSE
,
&
size
);
todo_wine
ok
(
hr
==
E_FAIL
,
"expected E_FAIL, got %#x
\n
"
,
hr
);
todo_wine
ok
(
size
==
-
1
,
"expected -1, got %d
\n
"
,
size
);
offset
.
QuadPart
=
0
;
hr
=
IStream_Seek
(
dst_stream
,
offset
,
SEEK_SET
,
NULL
);
ok
(
hr
==
S_OK
,
"IStream_Seek %#x
\n
"
,
hr
);
hr
=
IPicture_QueryInterface
(
pic
,
&
IID_IPersistStream
,
(
void
**
)
&
src_stream
);
ok
(
hr
==
S_OK
,
"QueryInterface error %#x
\n
"
,
hr
);
...
...
@@ -1160,6 +1206,7 @@ static void test_load_save_empty_picture(void)
IStream
*
dst_stream
,
*
stream
;
LARGE_INTEGER
offset
;
HRESULT
hr
;
LONG
size
;
memset
(
&
pic
,
0
,
sizeof
(
pic
));
desc
.
cbSizeofstruct
=
sizeof
(
desc
);
...
...
@@ -1169,7 +1216,7 @@ static void test_load_save_empty_picture(void)
type
=
-
1
;
hr
=
IPicture_get_Type
(
pic
,
&
type
);
ok
(
hr
==
S_OK
,
"get_Type error %#8
x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"get_Type error %#
x
\n
"
,
hr
);
ok
(
type
==
PICTYPE_NONE
,
"expected picture type PICTYPE_NONE, got %d
\n
"
,
type
);
handle
=
(
OLE_HANDLE
)
0xdeadbeef
;
...
...
@@ -1181,6 +1228,18 @@ static void test_load_save_empty_picture(void)
hr
=
CreateStreamOnHGlobal
(
hmem
,
FALSE
,
&
dst_stream
);
ok
(
hr
==
S_OK
,
"createstreamonhglobal error %#x
\n
"
,
hr
);
size
=
-
1
;
hr
=
IPicture_SaveAsFile
(
pic
,
dst_stream
,
TRUE
,
&
size
);
ok
(
hr
==
S_OK
,
"IPicture_SaveasFile error %#x
\n
"
,
hr
);
todo_wine
ok
(
size
==
-
1
,
"expected -1, got %d
\n
"
,
size
);
size
=
-
1
;
hr
=
IPicture_SaveAsFile
(
pic
,
dst_stream
,
FALSE
,
&
size
);
ok
(
hr
==
S_OK
,
"IPicture_SaveasFile error %#x
\n
"
,
hr
);
todo_wine
ok
(
size
==
-
1
,
"expected -1, got %d
\n
"
,
size
);
hr
=
IPicture_QueryInterface
(
pic
,
&
IID_IPersistStream
,
(
void
**
)
&
src_stream
);
ok
(
hr
==
S_OK
,
"QueryInterface error %#x
\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