Alistair Leslie-Hughes : inetcomm/tests: Add Attachment tests.
Alexandre Julliard
julliard at winehq.org
Tue Aug 30 10:30:46 CDT 2016
Module: wine
Branch: master
Commit: 002af352fac43d170aad216bf15098b27555539a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=002af352fac43d170aad216bf15098b27555539a
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Thu Aug 18 11:13:02 2016 +0000
inetcomm/tests: Add Attachment tests.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/inetcomm/tests/mimeole.c | 53 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/dlls/inetcomm/tests/mimeole.c b/dlls/inetcomm/tests/mimeole.c
index 011c19f..ce1e4af 100644
--- a/dlls/inetcomm/tests/mimeole.c
+++ b/dlls/inetcomm/tests/mimeole.c
@@ -338,6 +338,59 @@ static void test_CreateMessage(void)
hr = IMimeMessage_GetAttachments(msg, &count, &body_list);
ok(hr == S_OK, "ret %08x\n", hr);
ok(count == 2, "got %d\n", count);
+ if(count == 2)
+ {
+ ENCODINGTYPE encoding;
+ IMimeBody *attachment;
+ PROPVARIANT prop;
+
+ PropVariantInit(&prop);
+
+ hr = IMimeMessage_BindToObject(msg, body_list[0], &IID_IMimeBody, (void**)&attachment);
+ ok(hr == S_OK, "ret %08x\n", hr);
+
+ hr = IMimeBody_IsContentType(attachment, "multipart", NULL);
+ ok(hr == S_FALSE, "ret %08x\n", hr);
+
+ hr = IMimeBody_GetCurrentEncoding(attachment, &encoding);
+ ok(hr == S_OK, "ret %08x\n", hr);
+ todo_wine ok(encoding == IET_8BIT, "ret %d\n", encoding);
+
+ prop.vt = VT_LPSTR;
+ hr = IMimeBody_GetProp(attachment, "Content-Transfer-Encoding", 0, &prop);
+ ok(hr == S_OK, "ret %08x\n", hr);
+
+ ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt);
+ ok(!strcmp(prop.u.pszVal, "8bit"), "got %s\n", prop.u.pszVal);
+ PropVariantClear(&prop);
+
+ hr = IMimeBody_IsType(attachment, IBT_ATTACHMENT);
+ todo_wine ok(hr == S_FALSE, "ret %08x\n", hr);
+
+ IMimeBody_Release(attachment);
+
+ hr = IMimeMessage_BindToObject(msg, body_list[1], &IID_IMimeBody, (void**)&attachment);
+ ok(hr == S_OK, "ret %08x\n", hr);
+
+ hr = IMimeBody_IsContentType(attachment, "multipart", NULL);
+ ok(hr == S_FALSE, "ret %08x\n", hr);
+
+ hr = IMimeBody_GetCurrentEncoding(attachment, &encoding);
+ ok(hr == S_OK, "ret %08x\n", hr);
+ todo_wine ok(encoding == IET_7BIT, "ret %d\n", encoding);
+
+ prop.vt = VT_LPSTR;
+ hr = IMimeBody_GetProp(attachment, "Content-Transfer-Encoding", 0, &prop);
+ ok(hr == S_OK, "ret %08x\n", hr);
+ ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt);
+ ok(!strcmp(prop.u.pszVal, "7bit"), "got %s\n", prop.u.pszVal);
+ PropVariantClear(&prop);
+
+ hr = IMimeBody_IsType(attachment, IBT_ATTACHMENT);
+ ok(hr == S_OK, "ret %08x\n", hr);
+
+ IMimeBody_Release(attachment);
+ }
CoTaskMemFree(body_list);
hr = IMimeBody_GetCharset(body, &hcs);
More information about the wine-cvs
mailing list