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
139c2146
Commit
139c2146
authored
Aug 03, 2008
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Aug 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi/tests: Fix istream tests on win9x (GetTempPathW).
parent
5f6d8da9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
13 deletions
+43
-13
istream.c
dlls/shlwapi/tests/istream.c
+43
-13
No files found.
dlls/shlwapi/tests/istream.c
View file @
139c2146
...
...
@@ -209,8 +209,12 @@ static void test_SHCreateStreamOnFileA(DWORD mode, DWORD stgm)
/* invalid arguments */
stream
=
NULL
;
/* NT: ERROR_PATH_NOT_FOUND, 9x: ERROR_BAD_PATHNAME */
ret
=
(
*
pSHCreateStreamOnFileA
)(
NULL
,
mode
|
stgm
,
&
stream
);
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
),
"SHCreateStreamOnFileA: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), got 0x%08x
\n
"
,
ret
);
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
)
||
ret
==
HRESULT_FROM_WIN32
(
ERROR_BAD_PATHNAME
),
"SHCreateStreamOnFileA: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)"
"or HRESULT_FROM_WIN32(ERROR_BAD_PATHNAME), got 0x%08x
\n
"
,
ret
);
ok
(
stream
==
NULL
,
"SHCreateStreamOnFileA: expected a NULL IStream object, got %p
\n
"
,
stream
);
#if 0 /* This test crashes on WinXP SP2 */
...
...
@@ -290,13 +294,15 @@ static void test_SHCreateStreamOnFileW(DWORD mode, DWORD stgm)
HRESULT
ret
;
ULONG
refcount
;
WCHAR
test_file
[
MAX_PATH
];
static
const
WCHAR
testW_txt
[]
=
{
'\\'
,
't'
,
'e'
,
's'
,
't'
,
'W'
,
'.'
,
't'
,
'x'
,
't'
,
'\0'
};
CHAR
test_fileA
[
MAX_PATH
];
static
const
CHAR
testW_txt
[]
=
"
\\
testW.txt"
;
trace
(
"SHCreateStreamOnFileW: testing mode %d, STGM flags %08x
\n
"
,
mode
,
stgm
);
/* Don't used a fixed path for the testW.txt file */
GetTempPathW
(
MAX_PATH
,
test_file
);
lstrcatW
(
test_file
,
testW_txt
);
GetTempPathA
(
MAX_PATH
,
test_fileA
);
lstrcatA
(
test_fileA
,
testW_txt
);
MultiByteToWideChar
(
CP_ACP
,
0
,
test_fileA
,
-
1
,
test_file
,
MAX_PATH
);
/* invalid arguments */
...
...
@@ -373,7 +379,9 @@ static void test_SHCreateStreamOnFileW(DWORD mode, DWORD stgm)
refcount
=
IStream_Release
(
stream
);
ok
(
refcount
==
0
,
"SHCreateStreamOnFileW: expected 0, got %d
\n
"
,
refcount
);
ok
(
DeleteFileW
(
test_file
),
"SHCreateStreamOnFileW: could not delete the test file, got error %d
\n
"
,
GetLastError
());
ok
(
DeleteFileA
(
test_fileA
),
"SHCreateStreamOnFileW: could not delete the test file, got error %d
\n
"
,
GetLastError
());
}
}
...
...
@@ -385,13 +393,15 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
HRESULT
ret
;
ULONG
refcount
;
WCHAR
test_file
[
MAX_PATH
];
static
const
WCHAR
testEx_txt
[]
=
{
'\\'
,
't'
,
'e'
,
's'
,
't'
,
'E'
,
'x'
,
'.'
,
't'
,
'x'
,
't'
,
'\0'
};
CHAR
test_fileA
[
MAX_PATH
];
static
const
CHAR
testEx_txt
[]
=
"
\\
testEx.txt"
;
trace
(
"SHCreateStreamOnFileEx: testing mode %d, STGM flags %08x
\n
"
,
mode
,
stgm
);
/* Don't used a fixed path for the testEx.txt file */
GetTempPathW
(
MAX_PATH
,
test_file
);
lstrcatW
(
test_file
,
testEx_txt
);
GetTempPathA
(
MAX_PATH
,
test_fileA
);
lstrcatA
(
test_fileA
,
testEx_txt
);
MultiByteToWideChar
(
CP_ACP
,
0
,
test_fileA
,
-
1
,
test_file
,
MAX_PATH
);
/* invalid arguments */
...
...
@@ -404,7 +414,11 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileEx
)(
test_file
,
mode
,
0
,
FALSE
,
template
,
&
stream
);
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got 0x%08x
\n
"
,
ret
);
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
)
||
ret
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) or "
"HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got 0x%08x
\n
"
,
ret
);
ok
(
stream
==
NULL
,
"SHCreateStreamOnFileEx: expected a NULL IStream object, got %p
\n
"
,
stream
);
#if 0 /* This test crashes on WinXP SP2 */
...
...
@@ -425,12 +439,22 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
return
;
}
}
else
{
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got 0x%08x
\n
"
,
ret
);
ok
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
)
||
ret
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) or "
"HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got 0x%08x
\n
"
,
ret
);
}
ok
(
stream
==
NULL
,
"SHCreateStreamOnFileEx: expected a NULL IStream object, got %p
\n
"
,
stream
);
stream
=
NULL
;
ret
=
(
*
pSHCreateStreamOnFileEx
)(
test_file
,
mode
|
STGM_FAILIFTHERE
|
stgm
,
0
,
TRUE
,
NULL
,
&
stream
);
/* not supported on win9x */
if
(
broken
(
ret
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
)
&&
stream
==
NULL
))
{
skip
(
"Not supported
\n
"
);
DeleteFileA
(
test_fileA
);
return
;
}
ok
(
ret
==
S_OK
,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x
\n
"
,
ret
);
ok
(
stream
!=
NULL
,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL
\n
"
);
...
...
@@ -440,7 +464,9 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
refcount
=
IStream_Release
(
stream
);
ok
(
refcount
==
0
,
"SHCreateStreamOnFileEx: expected 0, got %d
\n
"
,
refcount
);
ok
(
DeleteFileW
(
test_file
),
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
ok
(
DeleteFileA
(
test_fileA
),
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
}
stream
=
NULL
;
...
...
@@ -454,7 +480,9 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
refcount
=
IStream_Release
(
stream
);
ok
(
refcount
==
0
,
"SHCreateStreamOnFileEx: expected 0, got %d
\n
"
,
refcount
);
ok
(
DeleteFileW
(
test_file
),
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
ok
(
DeleteFileA
(
test_fileA
),
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
}
stream
=
NULL
;
...
...
@@ -514,7 +542,9 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
ok
(
refcount
==
0
,
"SHCreateStreamOnFileEx: expected 0, got %d
\n
"
,
refcount
);
}
ok
(
DeleteFileW
(
test_file
),
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
ok
(
DeleteFileA
(
test_fileA
),
"SHCreateStreamOnFileEx: could not delete the test file, got error %d
\n
"
,
GetLastError
());
}
...
...
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