Module: wine Branch: master Commit: f8a1b7e5a5c375af628cb622c0f05c283b24dc89 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f8a1b7e5a5c375af628cb622c0...
Author: Huw Davies huw@codeweavers.com Date: Thu Apr 16 12:14:19 2009 +0100
ole32/tests: Tests that show the consumer data object isn't a singleton.
---
dlls/ole32/tests/clipboard.c | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index fc55d38..aadc1ec 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -862,8 +862,59 @@ static void test_set_clipboard(void) OleUninitialize(); }
+static void test_consumer_refs(void) +{ + HRESULT hr; + IDataObject *src, *get1, *get2, *get3; + LONG refs; + + OleInitialize(NULL); + + hr = DataObjectImpl_CreateText("data1", &src); + ok(hr == S_OK, "got %08x\n", hr); + + hr = OleSetClipboard(src); + ok(hr == S_OK, "got %08x\n", hr); + + hr = OleGetClipboard(&get1); + ok(hr == S_OK, "got %08x\n", hr); + + hr = OleGetClipboard(&get2); + ok(hr == S_OK, "got %08x\n", hr); + + ok(get1 == get2, "data objects differ\n"); + refs = IDataObject_Release(get2); +todo_wine + ok(refs == 1, "got %d\n", refs); + + OleFlushClipboard(); + + hr = OleGetClipboard(&get2); + ok(hr == S_OK, "got %08x\n", hr); + +todo_wine + ok(get1 != get2, "data objects match\n"); + + OleSetClipboard(NULL); + + hr = OleGetClipboard(&get3); + ok(hr == S_OK, "got %08x\n", hr); + +todo_wine { + ok(get1 != get3, "data objects match\n"); + ok(get2 != get3, "data objects match\n"); +} + + IDataObject_Release(get3); + IDataObject_Release(get2); + IDataObject_Release(get1); + IDataObject_Release(src); + + OleUninitialize(); +}
START_TEST(clipboard) { test_set_clipboard(); + test_consumer_refs(); }