Commit 00558c29 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

inetcomm/tests: Add IMimeMessage SetOption tests.

parent 84cf8ca0
...@@ -332,6 +332,68 @@ static void test_CreateMessage(void) ...@@ -332,6 +332,68 @@ static void test_CreateMessage(void)
IStream_Release(stream); IStream_Release(stream);
} }
static void test_MessageOptions(void)
{
static const char string[] = "XXXXX";
static const char zero[] = "0";
HRESULT hr;
IMimeMessage *msg;
PROPVARIANT prop;
hr = MimeOleCreateMessage(NULL, &msg);
ok(hr == S_OK, "ret %08x\n", hr);
PropVariantInit(&prop);
prop.vt = VT_BOOL;
prop.u.boolVal = TRUE;
hr = IMimeMessage_SetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
PropVariantClear(&prop);
hr = IMimeMessage_GetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
todo_wine ok(hr == S_OK, "ret %08x\n", hr);
todo_wine ok(prop.vt == VT_BOOL, "vt %08x\n", prop.vt);
todo_wine ok(prop.u.boolVal == TRUE, "Hide Attachments got %d\n", prop.u.boolVal);
PropVariantClear(&prop);
prop.vt = VT_LPSTR;
prop.u.pszVal = CoTaskMemAlloc(strlen(string)+1);
strcpy(prop.u.pszVal, string);
hr = IMimeMessage_SetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
todo_wine ok(hr == S_OK, "ret %08x\n", hr);
PropVariantClear(&prop);
hr = IMimeMessage_GetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
todo_wine ok(hr == S_OK, "ret %08x\n", hr);
todo_wine ok(prop.vt == VT_BOOL, "vt %08x\n", prop.vt);
todo_wine ok(prop.u.boolVal == TRUE, "Hide Attachments got %d\n", prop.u.boolVal);
PropVariantClear(&prop);
/* Invalid property type doesn't change the value */
prop.vt = VT_LPSTR;
prop.u.pszVal = CoTaskMemAlloc(strlen(zero)+1);
strcpy(prop.u.pszVal, zero);
hr = IMimeMessage_SetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
todo_wine ok(hr == S_OK, "ret %08x\n", hr);
PropVariantClear(&prop);
hr = IMimeMessage_GetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
todo_wine ok(hr == S_OK, "ret %08x\n", hr);
todo_wine ok(prop.vt == VT_BOOL, "vt %08x\n", prop.vt);
todo_wine ok(prop.u.boolVal == TRUE, "Hide Attachments got %d\n", prop.u.boolVal);
PropVariantClear(&prop);
/* Invalid OID */
prop.vt = VT_BOOL;
prop.u.boolVal = TRUE;
hr = IMimeMessage_SetOption(msg, 0xff00000a, &prop);
todo_wine ok(hr == MIME_E_INVALID_OPTION_ID, "ret %08x\n", hr);
PropVariantClear(&prop);
IMimeMessage_Release(msg);
}
void test_BindToObject(void) void test_BindToObject(void)
{ {
HRESULT hr; HRESULT hr;
...@@ -372,6 +434,7 @@ START_TEST(mimeole) ...@@ -372,6 +434,7 @@ START_TEST(mimeole)
test_CreateBody(); test_CreateBody();
test_Allocator(); test_Allocator();
test_CreateMessage(); test_CreateMessage();
test_MessageOptions();
test_BindToObject(); test_BindToObject();
test_MimeOleGetPropertySchema(); test_MimeOleGetPropertySchema();
OleUninitialize(); OleUninitialize();
......
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