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
d037b409
Commit
d037b409
authored
Dec 29, 2010
by
André Hentschel
Committed by
Alexandre Julliard
Dec 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi/tests: Don't test function directly when reporting GetLastError().
parent
a608fe93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
23 deletions
+31
-23
istream.c
dlls/shlwapi/tests/istream.c
+18
-13
ordinal.c
dlls/shlwapi/tests/ordinal.c
+13
-10
No files found.
dlls/shlwapi/tests/istream.c
View file @
d037b409
...
...
@@ -281,12 +281,15 @@ static void test_SHCreateStreamOnFileA(DWORD mode, DWORD stgm)
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileA: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
BOOL
delret
;
test_IStream_invalid_operations
(
stream
,
mode
);
refcount
=
IStream_Release
(
stream
);
ok
(
refcount
==
0
,
"SHCreateStreamOnFileA: expected 0, got %d
\n
"
,
refcount
);
ok
(
DeleteFileA
(
test_file
),
"SHCreateStreamOnFileA: could not delete file '%s', got error %d
\n
"
,
test_file
,
GetLastError
());
delret
=
DeleteFileA
(
test_file
);
ok
(
delret
,
"SHCreateStreamOnFileA: could not delete file '%s', got error %d
\n
"
,
test_file
,
GetLastError
());
}
}
...
...
@@ -388,14 +391,15 @@ static void test_SHCreateStreamOnFileW(DWORD mode, DWORD stgm)
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileW: expected a valid IStream object, got NULL
\n
"
);
if
(
stream
)
{
BOOL
delret
;
test_IStream_invalid_operations
(
stream
,
mode
);
refcount
=
IStream_Release
(
stream
);
ok
(
refcount
==
0
,
"SHCreateStreamOnFileW: expected 0, got %d
\n
"
,
refcount
);
ok
(
DeleteFileA
(
test_fileA
),
"SHCreateStreamOnFileW: could not delete the test file, got error %d
\n
"
,
GetLastError
());
delret
=
DeleteFileA
(
test_fileA
);
ok
(
delret
,
"SHCreateStreamOnFileW: could not delete the test file, got error %d
\n
"
,
GetLastError
());
}
}
...
...
@@ -409,6 +413,7 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
WCHAR
test_file
[
MAX_PATH
];
CHAR
test_fileA
[
MAX_PATH
];
static
const
CHAR
testEx_txt
[]
=
"
\\
testEx.txt"
;
BOOL
delret
;
trace
(
"SHCreateStreamOnFileEx: testing mode %d, STGM flags %08x
\n
"
,
mode
,
stgm
);
...
...
@@ -489,9 +494,9 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
refcount
=
IStream_Release
(
stream
);
ok
(
refcount
==
0
,
"SHCreateStreamOnFileEx: expected 0, got %d
\n
"
,
refcount
);
ok
(
DeleteFileA
(
test_fileA
),
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
delret
=
DeleteFileA
(
test_fileA
);
ok
(
delret
,
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
}
stream
=
NULL
;
...
...
@@ -510,9 +515,9 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
refcount
=
IStream_Release
(
stream
);
ok
(
refcount
==
0
,
"SHCreateStreamOnFileEx: expected 0, got %d
\n
"
,
refcount
);
ok
(
DeleteFileA
(
test_fileA
),
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
delret
=
DeleteFileA
(
test_fileA
);
ok
(
delret
,
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
}
stream
=
NULL
;
...
...
@@ -577,9 +582,9 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
ok
(
refcount
==
0
,
"SHCreateStreamOnFileEx: expected 0, got %d
\n
"
,
refcount
);
}
ok
(
DeleteFileA
(
test_fileA
),
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
delret
=
DeleteFileA
(
test_fileA
);
ok
(
delret
,
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
}
...
...
dlls/shlwapi/tests/ordinal.c
View file @
d037b409
...
...
@@ -636,19 +636,19 @@ static void test_GetShellSecurityDescriptor(void)
ok
(
psd
!=
NULL
,
"GetShellSecurityDescriptor failed
\n
"
);
if
(
psd
!=
NULL
)
{
BOOL
bHasDacl
=
FALSE
,
bDefaulted
;
BOOL
bHasDacl
=
FALSE
,
bDefaulted
,
ret
;
PACL
pAcl
;
DWORD
dwRev
;
SECURITY_DESCRIPTOR_CONTROL
control
;
ok
(
IsValidSecurityDescriptor
(
psd
),
"returned value is not valid SD
\n
"
);
ok
(
GetSecurityDescriptorControl
(
psd
,
&
control
,
&
dwRev
),
"GetSecurityDescriptorControl failed with error %u
\n
"
,
GetLastError
());
ret
=
GetSecurityDescriptorControl
(
psd
,
&
control
,
&
dwRev
);
ok
(
ret
,
"GetSecurityDescriptorControl failed with error %u
\n
"
,
GetLastError
());
ok
(
0
==
(
control
&
SE_SELF_RELATIVE
),
"SD should be absolute
\n
"
);
ok
(
GetSecurityDescriptorDacl
(
psd
,
&
bHasDacl
,
&
pAcl
,
&
bDefaulted
),
"GetSecurityDescriptorDacl failed with error %u
\n
"
,
GetLastError
());
ret
=
GetSecurityDescriptorDacl
(
psd
,
&
bHasDacl
,
&
pAcl
,
&
bDefaulted
);
ok
(
ret
,
"GetSecurityDescriptorDacl failed with error %u
\n
"
,
GetLastError
());
ok
(
bHasDacl
,
"SD has no DACL
\n
"
);
if
(
bHasDacl
)
...
...
@@ -662,28 +662,31 @@ static void test_GetShellSecurityDescriptor(void)
ok
(
IsValidAcl
(
pAcl
),
"DACL is not valid
\n
"
);
ok
(
GetAclInformation
(
pAcl
,
&
asiSize
,
sizeof
(
asiSize
),
AclSizeInformation
),
"GetAclInformation failed with error %u
\n
"
,
GetLastError
());
ret
=
GetAclInformation
(
pAcl
,
&
asiSize
,
sizeof
(
asiSize
),
AclSizeInformation
);
ok
(
ret
,
"GetAclInformation failed with error %u
\n
"
,
GetLastError
());
ok
(
asiSize
.
AceCount
==
3
,
"Incorrect number of ACEs: %d entries
\n
"
,
asiSize
.
AceCount
);
if
(
asiSize
.
AceCount
==
3
)
{
ACCESS_ALLOWED_ACE
*
paaa
;
/* will use for DENIED too */
ok
(
GetAce
(
pAcl
,
0
,
(
LPVOID
*
)
&
paaa
),
"GetAce failed with error %u
\n
"
,
GetLastError
());
ret
=
GetAce
(
pAcl
,
0
,
(
LPVOID
*
)
&
paaa
);
ok
(
ret
,
"GetAce failed with error %u
\n
"
,
GetLastError
());
ok
(
paaa
->
Header
.
AceType
==
ACCESS_ALLOWED_ACE_TYPE
,
"Invalid ACE type %d
\n
"
,
paaa
->
Header
.
AceType
);
ok
(
paaa
->
Header
.
AceFlags
==
0
,
"Invalid ACE flags %x
\n
"
,
paaa
->
Header
.
AceFlags
);
ok
(
paaa
->
Mask
==
GENERIC_ALL
,
"Invalid ACE mask %x
\n
"
,
paaa
->
Mask
);
ok
(
GetAce
(
pAcl
,
1
,
(
LPVOID
*
)
&
paaa
),
"GetAce failed with error %u
\n
"
,
GetLastError
());
ret
=
GetAce
(
pAcl
,
1
,
(
LPVOID
*
)
&
paaa
);
ok
(
ret
,
"GetAce failed with error %u
\n
"
,
GetLastError
());
ok
(
paaa
->
Header
.
AceType
==
ACCESS_DENIED_ACE_TYPE
,
"Invalid ACE type %d
\n
"
,
paaa
->
Header
.
AceType
);
/* first one of two ACEs generated from inheritable entry - without inheritance */
ok
(
paaa
->
Header
.
AceFlags
==
0
,
"Invalid ACE flags %x
\n
"
,
paaa
->
Header
.
AceFlags
);
ok
(
paaa
->
Mask
==
GENERIC_WRITE
,
"Invalid ACE mask %x
\n
"
,
paaa
->
Mask
);
ok
(
GetAce
(
pAcl
,
2
,
(
LPVOID
*
)
&
paaa
),
"GetAce failed with error %u
\n
"
,
GetLastError
());
ret
=
GetAce
(
pAcl
,
2
,
(
LPVOID
*
)
&
paaa
);
ok
(
ret
,
"GetAce failed with error %u
\n
"
,
GetLastError
());
ok
(
paaa
->
Header
.
AceType
==
ACCESS_DENIED_ACE_TYPE
,
"Invalid ACE type %d
\n
"
,
paaa
->
Header
.
AceType
);
/* second ACE - with inheritance */
...
...
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