Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
4c46194c
Commit
4c46194c
authored
Feb 06, 2007
by
Mike McCormack
Committed by
Alexandre Julliard
Feb 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add a few more tests for transacted storage.
parent
224ead82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
storage32.c
dlls/ole32/tests/storage32.c
+32
-1
No files found.
dlls/ole32/tests/storage32.c
View file @
4c46194c
...
...
@@ -862,10 +862,11 @@ static void test_transact(void)
static
const
WCHAR
szPrefix
[]
=
{
's'
,
't'
,
'g'
,
0
};
static
const
WCHAR
szDot
[]
=
{
'.'
,
0
};
WCHAR
filename
[
MAX_PATH
];
IStorage
*
stg
=
NULL
;
IStorage
*
stg
=
NULL
,
*
stg2
=
NULL
;
HRESULT
r
;
IStream
*
stm
=
NULL
;
static
const
WCHAR
stmname
[]
=
{
'C'
,
'O'
,
'N'
,
'T'
,
'E'
,
'N'
,
'T'
,
'S'
,
0
};
static
const
WCHAR
stmname2
[]
=
{
'F'
,
'O'
,
'O'
,
0
};
if
(
!
GetTempFileNameW
(
szDot
,
szPrefix
,
0
,
filename
))
return
;
...
...
@@ -878,9 +879,28 @@ static void test_transact(void)
ok
(
r
==
S_OK
,
"StgCreateDocfile failed
\n
"
);
/* now create a stream, but don't commit it */
r
=
IStorage_CreateStream
(
stg
,
stmname2
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->CreateStream failed
\n
"
);
r
=
IStream_Write
(
stm
,
"this is stream 1
\n
"
,
16
,
NULL
);
ok
(
r
==
S_OK
,
"IStream->Write failed
\n
"
);
r
=
IStream_Release
(
stm
);
r
=
IStorage_Commit
(
stg
,
0
);
ok
(
r
==
S_OK
,
"IStorage->Commit failed
\n
"
);
/* now create a stream, but don't commit it */
stm
=
NULL
;
r
=
IStorage_CreateStream
(
stg
,
stmname
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->CreateStream failed
\n
"
);
r
=
IStream_Write
(
stm
,
"this is stream 2
\n
"
,
16
,
NULL
);
ok
(
r
==
S_OK
,
"IStream->Write failed
\n
"
);
r
=
IStream_Commit
(
stm
,
STGC_ONLYIFCURRENT
|
STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE
);
ok
(
r
==
S_OK
,
"IStream->Commit failed
\n
"
);
r
=
IStream_Release
(
stm
);
IStorage_Release
(
stg
);
...
...
@@ -902,13 +922,24 @@ static void test_transact(void)
r
=
IStorage_OpenStream
(
stg
,
stmname
,
NULL
,
STGM_TRANSACTED
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stm
);
ok
(
r
==
STG_E_INVALIDFUNCTION
,
"IStorage->OpenStream failed %08x
\n
"
,
r
);
r
=
IStorage_OpenStorage
(
stg
,
stmname
,
NULL
,
STGM_TRANSACTED
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
NULL
,
0
,
&
stg2
);
ok
(
r
==
STG_E_FILENOTFOUND
,
"IStorage->OpenStream failed %08x
\n
"
,
r
);
todo_wine
{
r
=
IStorage_OpenStream
(
stg
,
stmname
,
NULL
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stm
);
ok
(
r
==
STG_E_FILENOTFOUND
,
"IStorage->OpenStream should fail %08x
\n
"
,
r
);
}
if
(
stm
)
r
=
IStream_Release
(
stm
);
r
=
IStorage_OpenStorage
(
stg
,
stmname2
,
NULL
,
STGM_TRANSACTED
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
NULL
,
0
,
&
stg2
);
ok
(
r
==
STG_E_FILENOTFOUND
,
"IStorage->OpenStream failed %08x
\n
"
,
r
);
r
=
IStorage_OpenStream
(
stg
,
stmname2
,
NULL
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->OpenStream should fail %08x
\n
"
,
r
);
if
(
stm
)
r
=
IStream_Release
(
stm
);
IStorage_Release
(
stg
);
r
=
DeleteFileW
(
filename
);
...
...
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