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
536aa9be
Commit
536aa9be
authored
Oct 02, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Add test for non-root transacted storage objects.
parent
3c9067de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
102 additions
and
0 deletions
+102
-0
storage32.c
dlls/ole32/tests/storage32.c
+102
-0
No files found.
dlls/ole32/tests/storage32.c
View file @
536aa9be
...
...
@@ -1185,6 +1185,107 @@ static void test_revert(void)
ok
(
r
==
TRUE
,
"deleted file
\n
"
);
}
static
void
test_nonroot_transacted
(
void
)
{
IStorage
*
stg
=
NULL
,
*
stg2
=
NULL
;
HRESULT
r
;
IStream
*
stm
=
NULL
;
static
const
WCHAR
stgname
[]
=
{
'P'
,
'E'
,
'R'
,
'M'
,
'S'
,
'T'
,
'G'
,
0
};
static
const
WCHAR
stmname
[]
=
{
'C'
,
'O'
,
'N'
,
'T'
,
'E'
,
'N'
,
'T'
,
'S'
,
0
};
static
const
WCHAR
stmname2
[]
=
{
'F'
,
'O'
,
'O'
,
0
};
DeleteFileA
(
filenameA
);
/* create a transacted file */
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgCreateDocfile failed
\n
"
);
/* create a transacted substorage */
r
=
IStorage_CreateStorage
(
stg
,
stgname
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
|
STGM_TRANSACTED
,
0
,
0
,
&
stg2
);
ok
(
r
==
S_OK
,
"IStorage->CreateStorage failed, hr=%08x
\n
"
,
r
);
if
(
r
==
S_OK
)
{
/* create and commit stmname */
r
=
IStorage_CreateStream
(
stg2
,
stmname
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->CreateStream failed
\n
"
);
if
(
r
==
S_OK
)
IStream_Release
(
stm
);
IStorage_Commit
(
stg2
,
0
);
/* create and revert stmname2 */
r
=
IStorage_CreateStream
(
stg2
,
stmname2
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->CreateStream failed
\n
"
);
if
(
r
==
S_OK
)
IStream_Release
(
stm
);
IStorage_Revert
(
stg2
);
/* check that Commit and Revert really worked */
r
=
IStorage_OpenStream
(
stg2
,
stmname
,
NULL
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->OpenStream should succeed %08x
\n
"
,
r
);
if
(
r
==
S_OK
)
IStream_Release
(
stm
);
r
=
IStorage_OpenStream
(
stg2
,
stmname2
,
NULL
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stm
);
todo_wine
ok
(
r
==
STG_E_FILENOTFOUND
,
"IStorage->OpenStream should fail %08x
\n
"
,
r
);
if
(
r
==
S_OK
)
IStream_Release
(
stm
);
IStorage_Release
(
stg2
);
}
IStream_Release
(
stg
);
/* create a non-transacted file */
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgCreateDocfile failed
\n
"
);
/* create a transacted substorage */
r
=
IStorage_CreateStorage
(
stg
,
stgname
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
|
STGM_TRANSACTED
,
0
,
0
,
&
stg2
);
ok
(
r
==
S_OK
,
"IStorage->CreateStorage failed, hr=%08x
\n
"
,
r
);
if
(
r
==
S_OK
)
{
/* create and commit stmname */
r
=
IStorage_CreateStream
(
stg2
,
stmname
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->CreateStream failed
\n
"
);
if
(
r
==
S_OK
)
IStream_Release
(
stm
);
IStorage_Commit
(
stg2
,
0
);
/* create and revert stmname2 */
r
=
IStorage_CreateStream
(
stg2
,
stmname2
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->CreateStream failed
\n
"
);
if
(
r
==
S_OK
)
IStream_Release
(
stm
);
IStorage_Revert
(
stg2
);
/* check that Commit and Revert really worked */
r
=
IStorage_OpenStream
(
stg2
,
stmname
,
NULL
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->OpenStream should succeed %08x
\n
"
,
r
);
if
(
r
==
S_OK
)
IStream_Release
(
stm
);
r
=
IStorage_OpenStream
(
stg2
,
stmname2
,
NULL
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stm
);
todo_wine
ok
(
r
==
STG_E_FILENOTFOUND
,
"IStorage->OpenStream should fail %08x
\n
"
,
r
);
if
(
r
==
S_OK
)
IStream_Release
(
stm
);
IStorage_Release
(
stg2
);
}
IStream_Release
(
stg
);
r
=
DeleteFileA
(
filenameA
);
ok
(
r
==
TRUE
,
"deleted file
\n
"
);
}
static
void
test_ReadClassStm
(
void
)
{
CLSID
clsid
;
...
...
@@ -1741,6 +1842,7 @@ START_TEST(storage32)
test_streamenum
();
test_transact
();
test_revert
();
test_nonroot_transacted
();
test_ReadClassStm
();
test_access
();
test_writeclassstg
();
...
...
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