Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/riched20/tests/richole.c | 9 +++++++++ dlls/riched20/tests/txtsrv.c | 9 +++++++++ 2 files changed, 18 insertions(+)
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index 3cea9902620..e6329c5b1b6 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c @@ -149,6 +149,7 @@ static void test_Interfaces(void) LRESULT res; HWND w; ULONG refcount; + IUnknown *unk, *unk2;
w = new_richedit(NULL); if (!w) { @@ -180,6 +181,14 @@ static void test_Interfaces(void) hres = ITextDocument_GetSelection(txtDoc, &txtSel); ok(hres == S_OK, "got 0x%08x\n", hres);
+ hres = ITextDocument_QueryInterface(txtDoc, &IID_IUnknown, (void **)&unk); + ok(hres == S_OK, "got 0x%08x\n", hres); + hres = ITextSelection_QueryInterface(txtSel, &IID_IUnknown, (void **)&unk2); + ok(hres == S_OK, "got 0x%08x\n", hres); + ok(unk != unk2, "unknowns are the same\n"); + IUnknown_Release(unk2); + IUnknown_Release(unk); + EXPECT_REF(txtDoc, 4); EXPECT_REF(txtSel, 2);
diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c index 6834e38b7f5..fe27be26edb 100644 --- a/dlls/riched20/tests/txtsrv.c +++ b/dlls/riched20/tests/txtsrv.c @@ -917,6 +917,7 @@ static void test_QueryInterface(void) IRichEditOle *reole, *txtsrv_reole; ITextDocument *txtdoc, *txtsrv_txtdoc; ITextDocument2Old *txtdoc2old, *txtsrv_txtdoc2old; + IUnknown *unk, *unk2; ULONG refcount;
if(!init_texthost(&txtserv, &host)) @@ -933,6 +934,14 @@ static void test_QueryInterface(void) refcount = get_refcount((IUnknown *)txtsrv_reole); ok(refcount == 2, "got wrong ref count: %d\n", refcount);
+ hres = ITextServices_QueryInterface( txtserv, &IID_IUnknown, (void **)&unk ); + ok( hres == S_OK, "got 0x%08x\n", hres ); + hres = IRichEditOle_QueryInterface( txtsrv_reole, &IID_IUnknown, (void **)&unk2 ); + ok( hres == S_OK, "got 0x%08x\n", hres ); + ok( unk == unk2, "unknowns differ\n" ); + IUnknown_Release( unk2 ); + IUnknown_Release( unk ); + hres = IRichEditOle_QueryInterface(txtsrv_reole, &IID_ITextDocument, (void **)&txtdoc); ok(hres == S_OK, "IRichEditOle_QueryInterface: 0x%08x\n", hres); refcount = get_refcount((IUnknown *)txtserv);