[1/4] qmgr: Implement IBackgroundCopyJob_GetType with test.
Dan Hipschman
dsh at linux.ucla.edu
Mon Feb 25 19:40:57 CST 2008
Implement IBackgroundCopyJob_GetType.
From: Roy Shea <roy at cs.hmc.edu>
Date: Thu Dec 20 18:38:31 CST 2007
---
dlls/qmgr/job.c | 9 +++++++--
dlls/qmgr/tests/job.c | 17 +++++++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c
index 8357b87..b15f39b 100644
--- a/dlls/qmgr/job.c
+++ b/dlls/qmgr/job.c
@@ -133,8 +133,13 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetType(
IBackgroundCopyJob* iface,
BG_JOB_TYPE *pVal)
{
- FIXME("Not implemented\n");
- return E_NOTIMPL;
+ BackgroundCopyJobImpl *This = (BackgroundCopyJobImpl *) iface;
+
+ if (!pVal)
+ return E_INVALIDARG;
+
+ *pVal = This->type;
+ return S_OK;
}
static HRESULT WINAPI BITS_IBackgroundCopyJob_GetProgress(
diff --git a/dlls/qmgr/tests/job.c b/dlls/qmgr/tests/job.c
index 71c0759..9f216da 100644
--- a/dlls/qmgr/tests/job.c
+++ b/dlls/qmgr/tests/job.c
@@ -83,12 +83,29 @@ static void test_GetId(void)
ok(memcmp(&tmpId, &test_jobId, sizeof tmpId) == 0, "Got incorrect GUID\n");
}
+/* Test that the type is properly set */
+static void test_GetType(void)
+{
+ HRESULT hres;
+ BG_JOB_TYPE type;
+
+ hres = IBackgroundCopyJob_GetType(test_job, &type);
+ ok(hres == S_OK, "GetType failed: %08x\n", hres);
+ if(hres != S_OK)
+ {
+ skip("Unable to get type of test_job.\n");
+ return;
+ }
+ ok(type == test_type, "Got incorrect type\n");
+}
+
typedef void (*test_t)(void);
START_TEST(job)
{
static const test_t tests[] = {
test_GetId,
+ test_GetType,
0
};
const test_t *test;
More information about the wine-patches
mailing list