Commit f8180550 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20/tests: Add some object identity tests.

parent 43d377c2
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment