Commit 917b2a36 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shlwapi/tests: Add some tests for memory stream.

parent 15059052
......@@ -733,6 +733,43 @@ static void test_SHCreateStreamOnFileEx_CopyTo(void)
DeleteFileW( dstFileName );
}
static void test_SHCreateMemStream(void)
{
static const BYTE initial[10];
IStream *stream, *stream2;
IUnknown *unk;
char buff[10];
HRESULT hr;
stream = SHCreateMemStream(initial, 0);
ok(stream != NULL, "Failed to create a stream.\n");
IStream_Release(stream);
stream = SHCreateMemStream(NULL, 10);
ok(stream != NULL, "Failed to create a stream.\n");
IStream_Release(stream);
stream = SHCreateMemStream(NULL, 0);
ok(stream != NULL, "Failed to create a stream.\n");
hr = IStream_QueryInterface(stream, &IID_ISequentialStream, (void **)&unk);
todo_wine
ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* WinXP */, "Failed to QI, hr %#x.\n", hr);
if (unk)
IUnknown_Release(unk);
hr = IStream_Read(stream, buff, sizeof(buff), NULL);
todo_wine
ok(hr == S_FALSE || broken(hr == S_OK) /* WinXP */, "Unexpected hr %#x.\n", hr);
hr = IStream_Clone(stream, &stream2);
todo_wine
ok(hr == S_OK || broken(hr == E_NOTIMPL) /* < Win8 */, "Failed to clone a stream, hr %#x.\n", hr);
if (hr == S_OK)
IStream_Release(stream2);
IStream_Release(stream);
}
START_TEST(istream)
{
......@@ -773,4 +810,5 @@ START_TEST(istream)
}
test_SHCreateStreamOnFileEx_CopyTo();
test_SHCreateMemStream();
}
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