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
575b1bfc
Commit
575b1bfc
authored
Feb 22, 2008
by
Roy Shea
Committed by
Alexandre Julliard
Feb 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qmgr: Implement IBackgroundCopyJob_GetId with test.
parent
111e6929
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
113 additions
and
2 deletions
+113
-2
job.c
dlls/qmgr/job.c
+3
-2
Makefile.in
dlls/qmgr/tests/Makefile.in
+1
-0
job.c
dlls/qmgr/tests/job.c
+109
-0
No files found.
dlls/qmgr/job.c
View file @
575b1bfc
...
...
@@ -124,8 +124,9 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetId(
IBackgroundCopyJob
*
iface
,
GUID
*
pVal
)
{
FIXME
(
"Not implemented
\n
"
);
return
E_NOTIMPL
;
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
memcpy
(
pVal
,
&
This
->
jobId
,
sizeof
*
pVal
);
return
S_OK
;
}
static
HRESULT
WINAPI
BITS_IBackgroundCopyJob_GetType
(
...
...
dlls/qmgr/tests/Makefile.in
View file @
575b1bfc
...
...
@@ -6,6 +6,7 @@ TESTDLL = qmgr.dll
IMPORTS
=
ole32 kernel32
CTESTS
=
\
job.c
\
qmgr.c
@MAKE_TEST_RULES@
...
...
dlls/qmgr/tests/job.c
0 → 100644
View file @
575b1bfc
/*
* Unit test suite for Background Copy Job Interface
*
* Copyright 2007 Google (Roy Shea)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#define COBJMACROS
#include "wine/test.h"
#include "bits.h"
/* Globals used by many tests */
static
const
WCHAR
test_displayName
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
0
};
static
IBackgroundCopyManager
*
test_manager
;
static
IBackgroundCopyJob
*
test_job
;
static
GUID
test_jobId
;
static
BG_JOB_TYPE
test_type
;
/* Generic test setup */
static
BOOL
setup
(
void
)
{
HRESULT
hres
;
test_manager
=
NULL
;
test_job
=
NULL
;
memset
(
&
test_jobId
,
0
,
sizeof
test_jobId
);
test_type
=
BG_JOB_TYPE_DOWNLOAD
;
hres
=
CoCreateInstance
(
&
CLSID_BackgroundCopyManager
,
NULL
,
CLSCTX_LOCAL_SERVER
,
&
IID_IBackgroundCopyManager
,
(
void
**
)
&
test_manager
);
if
(
hres
!=
S_OK
)
return
FALSE
;
hres
=
IBackgroundCopyManager_CreateJob
(
test_manager
,
test_displayName
,
test_type
,
&
test_jobId
,
&
test_job
);
if
(
hres
!=
S_OK
)
{
IBackgroundCopyManager_Release
(
test_manager
);
return
FALSE
;
}
return
TRUE
;
}
/* Generic test cleanup */
static
void
teardown
(
void
)
{
IBackgroundCopyJob_Release
(
test_job
);
IBackgroundCopyManager_Release
(
test_manager
);
}
/* Test that the jobId is properly set */
static
void
test_GetId
(
void
)
{
HRESULT
hres
;
GUID
tmpId
;
hres
=
IBackgroundCopyJob_GetId
(
test_job
,
&
tmpId
);
ok
(
hres
==
S_OK
,
"GetId failed: %08x
\n
"
,
hres
);
if
(
hres
!=
S_OK
)
{
skip
(
"Unable to get ID of test_job.
\n
"
);
return
;
}
ok
(
memcmp
(
&
tmpId
,
&
test_jobId
,
sizeof
tmpId
)
==
0
,
"Got incorrect GUID
\n
"
);
}
typedef
void
(
*
test_t
)(
void
);
START_TEST
(
job
)
{
static
const
test_t
tests
[]
=
{
test_GetId
,
0
};
const
test_t
*
test
;
CoInitialize
(
NULL
);
for
(
test
=
tests
;
*
test
;
++
test
)
{
/* Keep state seperate between tests. */
if
(
!
setup
())
{
skip
(
"Unable to setup test
\n
"
);
break
;
}
(
*
test
)();
teardown
();
}
CoUninitialize
();
}
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