Commit dc484a9b authored by Roy Shea's avatar Roy Shea Committed by Alexandre Julliard

qmgr: Implement IBackgroundCopyJob_GetProgress.

parent a0fd05f0
...@@ -163,8 +163,17 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetProgress( ...@@ -163,8 +163,17 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetProgress(
IBackgroundCopyJob* iface, IBackgroundCopyJob* iface,
BG_JOB_PROGRESS *pVal) BG_JOB_PROGRESS *pVal)
{ {
FIXME("Not implemented\n"); BackgroundCopyJobImpl *This = (BackgroundCopyJobImpl *) iface;
return E_NOTIMPL;
if (!pVal)
return E_INVALIDARG;
pVal->BytesTotal = This->jobProgress.BytesTotal;
pVal->BytesTransferred = This->jobProgress.BytesTransferred;
pVal->FilesTotal = This->jobProgress.FilesTotal;
pVal->FilesTransferred = This->jobProgress.FilesTransferred;
return S_OK;
} }
static HRESULT WINAPI BITS_IBackgroundCopyJob_GetTimes( static HRESULT WINAPI BITS_IBackgroundCopyJob_GetTimes(
...@@ -432,7 +441,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, ...@@ -432,7 +441,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type,
memcpy(pJobId, &This->jobId, sizeof(GUID)); memcpy(pJobId, &This->jobId, sizeof(GUID));
list_init(&This->files); list_init(&This->files);
This->jobProgress.BytesTotal = BG_SIZE_UNKNOWN; This->jobProgress.BytesTotal = 0;
This->jobProgress.BytesTransferred = 0; This->jobProgress.BytesTransferred = 0;
This->jobProgress.FilesTotal = 0; This->jobProgress.FilesTotal = 0;
This->jobProgress.FilesTransferred = 0; This->jobProgress.FilesTransferred = 0;
......
...@@ -218,6 +218,27 @@ static void test_EnumFiles(void) ...@@ -218,6 +218,27 @@ static void test_EnumFiles(void)
ok(res == 0, "Bad ref count on release: %u\n", res); ok(res == 0, "Bad ref count on release: %u\n", res);
} }
/* Test getting job progress */
static void test_GetProgress_preTransfer(void)
{
HRESULT hres;
BG_JOB_PROGRESS progress;
hres = IBackgroundCopyJob_GetProgress(test_job, &progress);
ok(hres == S_OK, "GetProgress failed: 0x%08x\n", hres);
if (hres != S_OK)
{
skip("Unable to get job progress\n");
teardown();
return;
}
ok(progress.BytesTotal == 0, "Incorrect BytesTotal: %llu\n", progress.BytesTotal);
ok(progress.BytesTransferred == 0, "Incorrect BytesTransferred: %llu\n", progress.BytesTransferred);
ok(progress.FilesTotal == 0, "Incorrect FilesTotal: %u\n", progress.FilesTotal);
ok(progress.FilesTransferred == 0, "Incorrect FilesTransferred %u\n", progress.FilesTransferred);
}
typedef void (*test_t)(void); typedef void (*test_t)(void);
START_TEST(job) START_TEST(job)
...@@ -228,6 +249,7 @@ START_TEST(job) ...@@ -228,6 +249,7 @@ START_TEST(job)
test_GetName, test_GetName,
test_AddFile, test_AddFile,
test_EnumFiles, test_EnumFiles,
test_GetProgress_preTransfer,
0 0
}; };
const test_t *test; const test_t *test;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment