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
4cd390ca
Commit
4cd390ca
authored
Feb 25, 2010
by
Reece Dunn
Committed by
Alexandre Julliard
Feb 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Improve the HGLOBAL stream tests for Seek.
parent
9d8160c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
153 additions
and
5 deletions
+153
-5
hglobalstream.c
dlls/ole32/tests/hglobalstream.c
+153
-5
No files found.
dlls/ole32/tests/hglobalstream.c
View file @
4cd390ca
...
@@ -75,22 +75,170 @@ static void test_streamonhglobal(IStream *pStream)
...
@@ -75,22 +75,170 @@ static void test_streamonhglobal(IStream *pStream)
hr
=
IStream_SetSize
(
pStream
,
ull
);
hr
=
IStream_SetSize
(
pStream
,
ull
);
ok_ole_success
(
hr
,
"IStream_SetSize"
);
ok_ole_success
(
hr
,
"IStream_SetSize"
);
/*
ignores HighPar
t */
/*
IStream_Seek -- NULL position argumen
t */
ll
.
u
.
HighPart
=
-
1
;
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
0
;
ll
.
u
.
LowPart
=
0
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_SET
,
&
ull
);
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_CUR
,
NULL
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
/* IStream_Seek -- valid position argument (seek from current position) */
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
0
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_CUR
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ok
(
ull
.
u
.
LowPart
==
sizeof
(
data
),
"should have set LowPart to %d instead of %d
\n
"
,
sizeof
(
data
),
ull
.
u
.
LowPart
);
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
/* IStream_Seek -- invalid seek argument */
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
123
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_END
+
1
,
&
ull
);
todo_wine
todo_wine
ok
(
hr
==
STG_E_SEEKERROR
,
"IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
ull
.
u
.
LowPart
==
sizeof
(
data
),
"should have set LowPart to %d instead of %d
\n
"
,
sizeof
(
data
),
ull
.
u
.
LowPart
);
todo_wine
ok
(
ull
.
u
.
HighPart
==
0
,
"should not have changed HighPart, got %d
\n
"
,
ull
.
u
.
HighPart
);
/* IStream_Seek -- valid position argument (seek to beginning) */
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
0
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_SET
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ok
(
ull
.
u
.
LowPart
==
0
,
"should have set LowPart to 0 instead of %d
\n
"
,
ull
.
u
.
LowPart
);
ok
(
ull
.
u
.
LowPart
==
0
,
"should have set LowPart to 0 instead of %d
\n
"
,
ull
.
u
.
LowPart
);
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
/* IStream_Seek -- valid position argument (seek to end) */
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
0
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_END
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ok
(
ull
.
u
.
LowPart
==
0
,
"should have set LowPart to 0 instead of %d
\n
"
,
ull
.
u
.
LowPart
);
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
/* IStream_Seek -- ignore HighPart in the move value (seek from current position) */
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
sizeof
(
data
);
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_SET
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
-
1
;
ll
.
u
.
LowPart
=
0
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_CUR
,
&
ull
);
todo_wine
ok_ole_success
(
hr
,
"IStream_Seek"
);
todo_wine
ok
(
ull
.
u
.
LowPart
==
sizeof
(
data
),
"should have set LowPart to %d instead of %d
\n
"
,
sizeof
(
data
),
ull
.
u
.
LowPart
);
todo_wine
todo_wine
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
/* ignores HighPart */
/* IStream_Seek -- ignore HighPart in the move value (seek to beginning) */
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
sizeof
(
data
);
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_SET
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
-
1
;
ll
.
u
.
HighPart
=
-
1
;
ll
.
u
.
LowPart
=
0
;
ll
.
u
.
LowPart
=
0
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_
CUR
,
NULL
);
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_
SET
,
&
ull
);
todo_wine
todo_wine
ok_ole_success
(
hr
,
"IStream_Seek"
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
todo_wine
ok
(
ull
.
u
.
LowPart
==
0
,
"should have set LowPart to 0 instead of %d
\n
"
,
ull
.
u
.
LowPart
);
todo_wine
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
/* IStream_Seek -- invalid LowPart value (seek from current position) */
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
sizeof
(
data
);
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_SET
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
0x80000000
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_CUR
,
&
ull
);
todo_wine
ok
(
hr
==
STG_E_SEEKERROR
,
"IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
ull
.
u
.
LowPart
==
sizeof
(
data
),
"should have set LowPart to %d instead of %d
\n
"
,
sizeof
(
data
),
ull
.
u
.
LowPart
);
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
/* IStream_Seek -- invalid LowPart value (seek to beginning) */
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
sizeof
(
data
);
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_SET
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
0x80000000
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_SET
,
&
ull
);
todo_wine
ok
(
hr
==
STG_E_SEEKERROR
,
"IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
ull
.
u
.
LowPart
==
sizeof
(
data
),
"should have set LowPart to %d instead of %d
\n
"
,
sizeof
(
data
),
ull
.
u
.
LowPart
);
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
/* IStream_Seek -- valid LowPart value (seek to beginning) */
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
0x7FFFFFFF
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_SET
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ok
(
ull
.
u
.
LowPart
==
0x7FFFFFFF
,
"should have set LowPart to 0x7FFFFFFF instead of %08x
\n
"
,
ull
.
u
.
LowPart
);
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
/* IStream_Seek -- valid LowPart value (seek from current position) */
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
0
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_SET
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
0x7FFFFFFF
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_CUR
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ok
(
ull
.
u
.
LowPart
==
0x7FFFFFFF
,
"should have set LowPart to 0x7FFFFFFF instead of %08x
\n
"
,
ull
.
u
.
LowPart
);
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
/* IStream_Seek -- second seek allows you to go past 0x7FFFFFFF size */
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
9
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_CUR
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ok
(
ull
.
u
.
LowPart
==
0x80000008
,
"should have set LowPart to 0x80000008 instead of %08x
\n
"
,
ull
.
u
.
LowPart
);
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
/* IStream_Seek -- seek wraps position/size on integer overflow */
ull
.
u
.
HighPart
=
0xCAFECAFE
;
ull
.
u
.
LowPart
=
0xCAFECAFE
;
ll
.
u
.
HighPart
=
0
;
ll
.
u
.
LowPart
=
0x7FFFFFFF
;
hr
=
IStream_Seek
(
pStream
,
ll
,
STREAM_SEEK_CUR
,
&
ull
);
ok_ole_success
(
hr
,
"IStream_Seek"
);
ok
(
ull
.
u
.
LowPart
==
0x00000007
,
"should have set LowPart to 0x00000007 instead of %08x
\n
"
,
ull
.
u
.
LowPart
);
todo_wine
ok
(
ull
.
u
.
HighPart
==
0
,
"should have set HighPart to 0 instead of %d
\n
"
,
ull
.
u
.
HighPart
);
hr
=
IStream_Commit
(
pStream
,
STGC_DEFAULT
);
hr
=
IStream_Commit
(
pStream
,
STGC_DEFAULT
);
ok_ole_success
(
hr
,
"IStream_Commit"
);
ok_ole_success
(
hr
,
"IStream_Commit"
);
...
...
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