Module: wine Branch: master Commit: 3f126b4a60ab7dde5d772147e23c7302df70f434 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3f126b4a60ab7dde5d772147e2...
Author: Roy Shea roy@cs.hmc.edu Date: Mon Feb 25 17:40:57 2008 -0800
qmgr: Implement IBackgroundCopyJob_GetType with test.
---
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;