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
202e7176
Commit
202e7176
authored
Nov 30, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qmgr/tests: Fixed some test failures on older windows versions.
parent
7a728d18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
19 deletions
+74
-19
enum_files.c
dlls/qmgr/tests/enum_files.c
+42
-1
file.c
dlls/qmgr/tests/file.c
+32
-18
No files found.
dlls/qmgr/tests/enum_files.c
View file @
202e7176
...
...
@@ -56,7 +56,40 @@ static HRESULT addFileHelper(IBackgroundCopyJob* job,
urlSize
=
MAX_PATH
;
UrlCreateFromPathW
(
remoteFile
,
remoteUrl
,
&
urlSize
,
0
);
UrlUnescapeW
(
remoteUrl
,
NULL
,
&
urlSize
,
URL_UNESCAPE_INPLACE
);
return
IBackgroundCopyJob_AddFile
(
test_job
,
remoteUrl
,
localFile
);
return
IBackgroundCopyJob_AddFile
(
job
,
remoteUrl
,
localFile
);
}
static
HRESULT
test_create_manager
(
void
)
{
HRESULT
hres
;
IBackgroundCopyManager
*
manager
=
NULL
;
/* Creating BITS instance */
hres
=
CoCreateInstance
(
&
CLSID_BackgroundCopyManager
,
NULL
,
CLSCTX_LOCAL_SERVER
,
&
IID_IBackgroundCopyManager
,
(
void
**
)
&
manager
);
if
(
hres
==
HRESULT_FROM_WIN32
(
ERROR_SERVICE_DISABLED
))
{
win_skip
(
"Needed Service is disabled
\n
"
);
return
hres
;
}
if
(
hres
==
S_OK
)
{
IBackgroundCopyJob
*
job
;
GUID
jobId
;
hres
=
IBackgroundCopyManager_CreateJob
(
manager
,
test_displayName
,
BG_JOB_TYPE_DOWNLOAD
,
&
jobId
,
&
job
);
if
(
hres
==
S_OK
)
{
hres
=
addFileHelper
(
job
,
test_localNameA
,
test_remoteNameA
);
if
(
hres
!=
S_OK
)
win_skip
(
"AddFile() with file:// protocol failed. Tests will be skipped.
\n
"
);
IBackgroundCopyJob_Release
(
job
);
}
IBackgroundCopyManager_Release
(
manager
);
}
return
hres
;
}
/* Generic test setup */
...
...
@@ -251,6 +284,14 @@ START_TEST(enum_files)
int
i
;
CoInitialize
(
NULL
);
if
(
FAILED
(
test_create_manager
()))
{
CoUninitialize
();
win_skip
(
"Failed to create Manager instance, skipping tests
\n
"
);
return
;
}
for
(
test
=
tests
,
i
=
0
;
*
test
;
++
test
,
++
i
)
{
/* Keep state separate between tests. */
...
...
dlls/qmgr/tests/file.c
View file @
202e7176
...
...
@@ -40,6 +40,25 @@ static IBackgroundCopyManager *test_manager;
static
IEnumBackgroundCopyFiles
*
test_enumFiles
;
static
IBackgroundCopyFile
*
test_file
;
/* Helper function to add a file to a job. The helper function takes base
file name and creates properly formed path and URL strings for creation of
the file. */
static
HRESULT
addFileHelper
(
IBackgroundCopyJob
*
job
,
const
WCHAR
*
localName
,
const
WCHAR
*
remoteName
)
{
DWORD
urlSize
;
GetCurrentDirectoryW
(
MAX_PATH
,
test_localFile
);
PathAppendW
(
test_localFile
,
localName
);
GetCurrentDirectoryW
(
MAX_PATH
,
test_remoteUrl
);
PathAppendW
(
test_remoteUrl
,
remoteName
);
urlSize
=
MAX_PATH
;
UrlCreateFromPathW
(
test_remoteUrl
,
test_remoteUrl
,
&
urlSize
,
0
);
UrlUnescapeW
(
test_remoteUrl
,
NULL
,
&
urlSize
,
URL_UNESCAPE_INPLACE
);
return
IBackgroundCopyJob_AddFile
(
job
,
test_remoteUrl
,
test_localFile
);
}
static
HRESULT
test_create_manager
(
void
)
{
HRESULT
hres
;
...
...
@@ -55,29 +74,24 @@ static HRESULT test_create_manager(void)
}
if
(
hres
==
S_OK
)
{
IBackgroundCopyJob
*
job
;
GUID
jobId
;
hres
=
IBackgroundCopyManager_CreateJob
(
manager
,
test_displayName
,
BG_JOB_TYPE_DOWNLOAD
,
&
jobId
,
&
job
);
if
(
hres
==
S_OK
)
{
hres
=
addFileHelper
(
job
,
test_localName
,
test_remoteName
);
if
(
hres
!=
S_OK
)
win_skip
(
"AddFile() with file:// protocol failed. Tests will be skipped.
\n
"
);
IBackgroundCopyJob_Release
(
job
);
}
IBackgroundCopyManager_Release
(
manager
);
}
return
hres
;
}
/* Helper function to add a file to a job. The helper function takes base
file name and creates properly formed path and URL strings for creation of
the file. */
static
HRESULT
addFileHelper
(
IBackgroundCopyJob
*
job
,
const
WCHAR
*
localName
,
const
WCHAR
*
remoteName
)
{
DWORD
urlSize
;
GetCurrentDirectoryW
(
MAX_PATH
,
test_localFile
);
PathAppendW
(
test_localFile
,
localName
);
GetCurrentDirectoryW
(
MAX_PATH
,
test_remoteUrl
);
PathAppendW
(
test_remoteUrl
,
remoteName
);
urlSize
=
MAX_PATH
;
UrlCreateFromPathW
(
test_remoteUrl
,
test_remoteUrl
,
&
urlSize
,
0
);
UrlUnescapeW
(
test_remoteUrl
,
NULL
,
&
urlSize
,
URL_UNESCAPE_INPLACE
);
return
IBackgroundCopyJob_AddFile
(
test_job
,
test_remoteUrl
,
test_localFile
);
}
/* Generic test setup */
static
BOOL
setup
(
void
)
{
...
...
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