Commit c607ab96 authored by Austin Lund's avatar Austin Lund Committed by Alexandre Julliard

riched20/tests: Added ITextServices::TxSetText test.

parent e90c8f53
......@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = riched20.dll
IMPORTS = ole32 user32 gdi32 kernel32
IMPORTS = ole32 oleaut32 user32 gdi32 kernel32
CTESTS = \
editor.c \
......
......@@ -31,6 +31,7 @@
#include <initguid.h>
#include <textserv.h>
#include <wine/test.h>
#include <oleauto.h>
static HMODULE hmoduleRichEdit;
......@@ -641,6 +642,30 @@ static void test_TxGetText(void)
CoTaskMemFree(dummyTextHost);
}
static void test_TxSetText(void)
{
HRESULT hres;
BSTR rettext;
WCHAR settext[] = {'T','e','s','t',0};
if (!init_texthost())
return;
hres = ITextServices_TxSetText(txtserv, settext);
todo_wine ok(hres == S_OK, "ITextServices_TxSetText failed\n");
hres = ITextServices_TxGetText(txtserv, &rettext);
todo_wine ok(hres == S_OK, "ITextServices_TxGetText failed\n");
todo_wine ok(SysStringLen(rettext) == 4,
"String returned of wrong length\n");
todo_wine ok(memcmp(rettext,settext,SysStringByteLen(rettext)) == 0,
"String returned differs\n");
IUnknown_Release(txtserv);
CoTaskMemFree(dummyTextHost);
}
START_TEST( txtsrv )
{
setup_thiscall_wrappers();
......@@ -656,6 +681,7 @@ START_TEST( txtsrv )
CoTaskMemFree(dummyTextHost);
test_TxGetText();
test_TxSetText();
}
if (wrapperCodeMem) VirtualFree(wrapperCodeMem, 0, MEM_RELEASE);
}
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