mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 19:47:27 +00:00
scrrun/tests: Add test of lost trailing byte in unicode srteam.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f2b681db77
commit
9294823a7b
|
@ -2032,6 +2032,32 @@ static void test_Read(void)
|
||||||
|
|
||||||
ITextStream_Release(stream);
|
ITextStream_Release(stream);
|
||||||
|
|
||||||
|
/* ASCII file, read with Unicode stream */
|
||||||
|
/* 3. one byte content, 2 are interpreted as a character, 3rd is lost */
|
||||||
|
hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_TRUE, VARIANT_FALSE, &stream);
|
||||||
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
|
str = SysAllocString(L"abc");
|
||||||
|
hr = ITextStream_Write(stream, str);
|
||||||
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
|
SysFreeString(str);
|
||||||
|
ITextStream_Release(stream);
|
||||||
|
|
||||||
|
hr = IFileSystem3_OpenTextFile(fs3, nameW, ForReading, VARIANT_FALSE, TristateTrue, &stream);
|
||||||
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
|
|
||||||
|
str = NULL;
|
||||||
|
hr = ITextStream_Read(stream, 500, &str);
|
||||||
|
ok(hr == S_FALSE || broken(hr == S_OK) /* win2003 */, "got 0x%08x\n", hr);
|
||||||
|
ok(SysStringLen(str) == 1, "len = %u\n", SysStringLen(str));
|
||||||
|
SysFreeString(str);
|
||||||
|
|
||||||
|
str = (void*)0xdeadbeef;
|
||||||
|
hr = ITextStream_Read(stream, 500, &str);
|
||||||
|
ok(hr == CTL_E_ENDOFFILE, "got 0x%08x\n", hr);
|
||||||
|
ok(str == NULL, "got %p\n", str);
|
||||||
|
|
||||||
|
ITextStream_Release(stream);
|
||||||
|
|
||||||
DeleteFileW(nameW);
|
DeleteFileW(nameW);
|
||||||
RemoveDirectoryW(dirW);
|
RemoveDirectoryW(dirW);
|
||||||
SysFreeString(nameW);
|
SysFreeString(nameW);
|
||||||
|
|
Loading…
Reference in a new issue