inetcomm: Implement IMimeBody_IsType(IBT_EMPTY).

This commit is contained in:
Huw Davies 2008-09-22 14:36:13 +01:00 committed by Alexandre Julliard
parent cfbd34cac7
commit 59091374e8
2 changed files with 16 additions and 2 deletions

View File

@ -864,8 +864,17 @@ static HRESULT WINAPI MimeBody_IsType(
IMimeBody* iface,
IMSGBODYTYPE bodytype)
{
FIXME("(%p)->(%d): stub\n", iface, bodytype);
return E_NOTIMPL;
MimeBody *This = impl_from_IMimeBody(iface);
TRACE("(%p)->(%d)\n", iface, bodytype);
switch(bodytype)
{
case IBT_EMPTY:
return This->data ? S_FALSE : S_OK;
default:
FIXME("Unimplemented bodytype %d - returning S_OK\n", bodytype);
}
return S_OK;
}
static HRESULT WINAPI MimeBody_SetDisplayName(

View File

@ -130,6 +130,8 @@ static void test_CreateBody(void)
ok(hr == S_FALSE, "ret %08x\n", hr);
hr = IMimeBody_IsContentType(body, NULL, "mixed");
ok(hr == S_OK, "ret %08x\n", hr);
hr = IMimeBody_IsType(body, IBT_EMPTY);
ok(hr == S_OK, "got %08x\n", hr);
hr = IMimeBody_SetData(body, IET_8BIT, "text", "plain", &IID_IStream, in);
ok(hr == S_OK, "ret %08x\n", hr);
@ -148,6 +150,9 @@ static void test_CreateBody(void)
ok(offsets.cbBodyStart == 0, "got %d\n", offsets.cbBodyStart);
ok(offsets.cbBodyEnd == 0, "got %d\n", offsets.cbBodyEnd);
hr = IMimeBody_IsType(body, IBT_EMPTY);
ok(hr == S_FALSE, "got %08x\n", hr);
hr = MimeOleGetAllocator(&alloc);
ok(hr == S_OK, "ret %08x\n", hr);