Commit b526f7a4 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32/tests: Move stream creation to test function that's using it.

parent baa74bd8
......@@ -43,16 +43,20 @@ do { \
} \
} while(0)
static void test_streamonhglobal(IStream *pStream)
static void test_streamonhglobal(void)
{
const char data[] = "Test String";
ULARGE_INTEGER ull;
IStream *pStream;
LARGE_INTEGER ll;
char buffer[128];
ULONG read;
STATSTG statstg;
HRESULT hr;
hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr);
ull.QuadPart = sizeof(data);
hr = IStream_SetSize(pStream, ull);
ok_ole_success(hr, "IStream_SetSize");
......@@ -293,6 +297,8 @@ static void test_streamonhglobal(IStream *pStream)
hr = IStream_SetSize(pStream, ull);
ok(hr == E_OUTOFMEMORY || broken(hr == S_OK), /* win9x */
"IStream_SetSize with large size should have returned E_OUTOFMEMORY instead of 0x%08x\n", hr);
IStream_Release(pStream);
}
static HRESULT WINAPI TestStream_QueryInterface(IStream *iface, REFIID riid, void **ppv)
......@@ -510,14 +516,7 @@ static void test_freed_hglobal(void)
START_TEST(hglobalstream)
{
HRESULT hr;
IStream *pStream;
hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
ok_ole_success(hr, "CreateStreamOnHGlobal");
test_streamonhglobal(pStream);
IStream_Release(pStream);
test_streamonhglobal();
test_copyto();
test_freed_hglobal();
}
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