qmgr: Implement IBackgroundCopyJob_GetProgress.

oldstable
Roy Shea 2008-03-03 16:48:08 -08:00 committed by Alexandre Julliard
parent a0fd05f09e
commit dc484a9b93
2 changed files with 34 additions and 3 deletions

View File

@ -163,8 +163,17 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetProgress(
IBackgroundCopyJob* iface,
BG_JOB_PROGRESS *pVal)
{
FIXME("Not implemented\n");
return E_NOTIMPL;
BackgroundCopyJobImpl *This = (BackgroundCopyJobImpl *) iface;
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(
@ -432,7 +441,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type,
memcpy(pJobId, &This->jobId, sizeof(GUID));
list_init(&This->files);
This->jobProgress.BytesTotal = BG_SIZE_UNKNOWN;
This->jobProgress.BytesTotal = 0;
This->jobProgress.BytesTransferred = 0;
This->jobProgress.FilesTotal = 0;
This->jobProgress.FilesTransferred = 0;

View File

@ -218,6 +218,27 @@ static void test_EnumFiles(void)
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);
START_TEST(job)
@ -228,6 +249,7 @@ START_TEST(job)
test_GetName,
test_AddFile,
test_EnumFiles,
test_GetProgress_preTransfer,
0
};
const test_t *test;