Module: wine Branch: master Commit: 3c8f5c581d93c36b04c58de35d27b0397c56de52 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3c8f5c581d93c36b04c58de35d...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Jan 27 16:00:20 2017 +0100
inetcomm: Test current encoding in test_SetData.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/inetcomm/tests/mimeole.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/dlls/inetcomm/tests/mimeole.c b/dlls/inetcomm/tests/mimeole.c index 9fbaeec..5d7bb9a 100644 --- a/dlls/inetcomm/tests/mimeole.c +++ b/dlls/inetcomm/tests/mimeole.c @@ -131,6 +131,17 @@ static IStream *create_stream_from_string(const char *data) return stream; }
+#define test_current_encoding(a,b) _test_current_encoding(__LINE__,a,b) +static void _test_current_encoding(unsigned line, IMimeBody *mime_body, ENCODINGTYPE encoding) +{ + ENCODINGTYPE current_encoding; + HRESULT hres; + + hres = IMimeBody_GetCurrentEncoding(mime_body, ¤t_encoding); + ok_(__FILE__,line)(hres == S_OK, "GetCurrentEncoding failed: %08x\n", hres); + ok_(__FILE__,line)(current_encoding == encoding, "encoding = %d, expected %d\n", current_encoding, encoding); +} + static void test_CreateBody(void) { HRESULT hr; @@ -158,9 +169,7 @@ static void test_CreateBody(void) hr = IMimeBody_InitNew(body); ok(hr == S_OK, "ret %08x\n", hr);
- hr = IMimeBody_GetCurrentEncoding(body, &enc); - ok(hr == S_OK, "ret %08x\n", hr); - ok(enc == IET_7BIT, "encoding %d\n", enc); + test_current_encoding(body, IET_7BIT);
hr = IMimeBody_Load(body, in); ok(hr == S_OK, "ret %08x\n", hr); @@ -445,6 +454,8 @@ static void test_SetData(void) todo_wine ok(hr == S_OK, "ret %08x\n", hr);
+ test_current_encoding(body, IET_BINARY); + SET_EXPECT(Stream_Stat); SET_EXPECT(Stream_Seek_END); hr = IMimeBody_GetData(body, IET_BINARY, &stream);