From: Daniel Lehman dlehman25@gmail.com
--- dlls/oleaut32/tests/olepicture.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index c6ab4ed0a19..e340eacf272 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -1206,6 +1206,7 @@ static void test_load_save_bmp(void) LARGE_INTEGER offset; HRESULT hr; LONG size; + ULARGE_INTEGER maxsize;
desc.cbSizeofstruct = sizeof(desc); desc.picType = PICTYPE_BITMAP; @@ -1251,6 +1252,13 @@ static void test_load_save_bmp(void) hr = IPicture_QueryInterface(pic, &IID_IPersistStream, (void **)&src_stream); ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
+ maxsize.QuadPart = 0; + hr = IPersistStream_GetSizeMax(src_stream, &maxsize); + todo_wine + ok(hr == S_OK, "GetSizeMax error %#lx\n", hr); + todo_wine + ok(maxsize.QuadPart == 74, "expected 74, got %s\n", wine_dbgstr_longlong(maxsize.QuadPart)); + hr = IPersistStream_Save(src_stream, dst_stream, TRUE); ok(hr == S_OK, "Save error %#lx\n", hr);
@@ -1282,6 +1290,7 @@ static void test_load_save_icon(void) LARGE_INTEGER offset; HRESULT hr; LONG size; + ULARGE_INTEGER maxsize;
desc.cbSizeofstruct = sizeof(desc); desc.picType = PICTYPE_ICON; @@ -1326,6 +1335,13 @@ static void test_load_save_icon(void) hr = IPicture_QueryInterface(pic, &IID_IPersistStream, (void **)&src_stream); ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
+ maxsize.QuadPart = 0; + hr = IPersistStream_GetSizeMax(src_stream, &maxsize); + todo_wine + ok(hr == S_OK, "GetSizeMax error %#lx\n", hr); + todo_wine + ok(maxsize.QuadPart == 774, "expected 774, got %s\n", wine_dbgstr_longlong(maxsize.QuadPart)); + hr = IPersistStream_Save(src_stream, dst_stream, TRUE); ok(hr == S_OK, "Saveerror %#lx\n", hr);
@@ -1358,6 +1374,7 @@ static void test_load_save_empty_picture(void) LARGE_INTEGER offset; HRESULT hr; LONG size; + ULARGE_INTEGER maxsize;
memset(&pic, 0, sizeof(pic)); desc.cbSizeofstruct = sizeof(desc); @@ -1394,6 +1411,17 @@ static void test_load_save_empty_picture(void) hr = IPicture_QueryInterface(pic, &IID_IPersistStream, (void **)&src_stream); ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
+ maxsize.QuadPart = 0; + hr = IPersistStream_GetSizeMax(src_stream, &maxsize); + todo_wine + ok(hr == S_OK, "GetSizeMax error %#lx\n", hr); + todo_wine + ok(maxsize.QuadPart == 8, "expected 8, got %s\n", wine_dbgstr_longlong(maxsize.QuadPart)); + + hr = IPersistStream_GetSizeMax(src_stream, NULL); + todo_wine + ole_expect(hr, E_INVALIDARG); + hr = IPersistStream_Save(src_stream, dst_stream, TRUE); ok(hr == S_OK, "Save error %#lx\n", hr);