infosoft/tests: Fix the infinite loop and crash on Windows 10 1607+.
The test only has expected data for the first four words. So abort if more are found. Signed-off-by: Francois Gouget <fgouget@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
21e002aa7e
commit
86edbc8b14
|
@ -70,11 +70,20 @@ static ULONG WINAPI ws_Release(IWordSink *iface)
|
||||||
static HRESULT WINAPI ws_PutWord(IWordSink *iface, ULONG cwc, const WCHAR *pwcInBuf,
|
static HRESULT WINAPI ws_PutWord(IWordSink *iface, ULONG cwc, const WCHAR *pwcInBuf,
|
||||||
ULONG cwcSrcLen, ULONG cwcSrcPos)
|
ULONG cwcSrcLen, ULONG cwcSrcPos)
|
||||||
{
|
{
|
||||||
ok(testres[wordnum].len == cwcSrcLen, "wrong length\n");
|
HRESULT rc = S_OK;
|
||||||
ok(!cwcSrcPos ||(testres[wordnum].ofs == cwcSrcPos), "wrong offset\n");
|
if (wordnum < ARRAY_SIZE(testres))
|
||||||
ok(!memcmp(testres[wordnum].data, pwcInBuf, cwcSrcLen), "wrong data\n");
|
{
|
||||||
|
ok(testres[wordnum].len == cwcSrcLen, "wrong length\n");
|
||||||
|
ok(!cwcSrcPos ||(testres[wordnum].ofs == cwcSrcPos), "wrong offset\n");
|
||||||
|
ok(!memcmp(testres[wordnum].data, pwcInBuf, cwcSrcLen), "wrong data\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ok(0, "found too many words: %d\n", wordnum + 1);
|
||||||
|
rc = E_FAIL;
|
||||||
|
}
|
||||||
wordnum++;
|
wordnum++;
|
||||||
return S_OK;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ws_PutAltWord(IWordSink *iface, ULONG cwc, const WCHAR *pwcInBuf,
|
static HRESULT WINAPI ws_PutAltWord(IWordSink *iface, ULONG cwc, const WCHAR *pwcInBuf,
|
||||||
|
|
Loading…
Reference in New Issue