Module: wine Branch: master Commit: b624e8125c91dcc10d65c99259f82d2ce7efcc20 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b624e8125c91dcc10d65c99259...
Author: Rob Shearman rob@codeweavers.com Date: Sun Jan 7 12:16:25 2007 +0000
ole32: Fix the OLE clipboard test to call OleInitialize before performing the tests to fix test failures on Windows.
---
dlls/ole32/tests/clipboard.c | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index 165863d..0127ce5 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -119,8 +119,10 @@ static HRESULT WINAPI EnumFormatImpl_Ski
static HRESULT WINAPI EnumFormatImpl_Reset(IEnumFORMATETC *iface) { - ok(0, "unexpected call\n"); - return E_NOTIMPL; + EnumFormatImpl *This = (EnumFormatImpl*)iface; + + This->cur = 0; + return S_OK; }
static HRESULT WINAPI EnumFormatImpl_Clone(IEnumFORMATETC *iface, IEnumFORMATETC **ppenum) @@ -329,6 +331,19 @@ static void test_set_clipboard(void) return;
hr = OleSetClipboard(data1); + todo_wine + ok(hr == CO_E_NOTINITIALIZED, "OleSetClipboard should have failed with CO_E_NOTINITIALIZED instead of 0x%08x\n", hr); + + CoInitialize(NULL); + hr = OleSetClipboard(data1); + todo_wine + ok(hr == CO_E_NOTINITIALIZED, "OleSetClipboard should have failed with CO_E_NOTINITIALIZED instead of 0x%08x\n", hr); + CoUninitialize(); + + hr = OleInitialize(NULL); + ok(hr == S_OK, "OleInitialize failed with error 0x%08x\n", hr); + + hr = OleSetClipboard(data1); ok(hr == S_OK, "failed to set clipboard to data1, hr = 0x%08x\n", hr); hr = OleIsCurrentClipboard(data1); ok(hr == S_OK, "expected current clipboard to be data1, hr = 0x%08x\n", hr); @@ -355,6 +370,8 @@ static void test_set_clipboard(void) ok(ref == 0, "expected data1 ref=0, got %d\n", ref); ref = IDataObject_Release(data2); ok(ref == 0, "expected data2 ref=0, got %d\n", ref); + + OleUninitialize(); }