shlwapi/tests: Skip some of IStream invalid parameter tests under Windows 2000 + IE5.

This commit is contained in:
Dmitry Timoshkov 2013-09-23 16:54:34 +09:00 committed by Alexandre Julliard
parent 09524be583
commit 50c4723aec
1 changed files with 27 additions and 13 deletions

View File

@ -35,6 +35,7 @@ static HRESULT (WINAPI *pSHCreateStreamOnFileA)(LPCSTR file, DWORD mode, IStream
static HRESULT (WINAPI *pSHCreateStreamOnFileW)(LPCWSTR file, DWORD mode, IStream **stream); static HRESULT (WINAPI *pSHCreateStreamOnFileW)(LPCWSTR file, DWORD mode, IStream **stream);
static HRESULT (WINAPI *pSHCreateStreamOnFileEx)(LPCWSTR file, DWORD mode, DWORD attributes, BOOL create, IStream *template, IStream **stream); static HRESULT (WINAPI *pSHCreateStreamOnFileEx)(LPCWSTR file, DWORD mode, DWORD attributes, BOOL create, IStream *template, IStream **stream);
static BOOL is_win2000_IE5 = FALSE;
static void test_IStream_invalid_operations(IStream * stream, DWORD mode) static void test_IStream_invalid_operations(IStream * stream, DWORD mode)
{ {
@ -76,40 +77,53 @@ static void test_IStream_invalid_operations(IStream * stream, DWORD mode)
ret = stream->lpVtbl->Write(stream, NULL, 0, &count); ret = stream->lpVtbl->Write(stream, NULL, 0, &count);
if (mode == STGM_READ) if (mode == STGM_READ)
ok(ret == STG_E_ACCESSDENIED /* XP */ || ret == S_OK /* 2000 */, {
"expected STG_E_ACCESSDENIED or S_OK, got 0x%08x\n", ret); ok(ret == STG_E_ACCESSDENIED /* XP */ || broken(ret == S_OK) /* Win2000 + IE5 */,
"expected STG_E_ACCESSDENIED, got 0x%08x\n", ret);
if (ret == S_OK)
is_win2000_IE5 = TRUE;
}
else else
ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret); ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret);
/* IStream::Write calls below hang under Win2000 + IE5, Win2000 + IE6 SP1
* and newer Windows versions pass these tests.
*/
if (is_win2000_IE5)
{
win_skip("broken IStream::Write implementation (win2000)\n");
return;
}
strcpy(data, "Hello"); strcpy(data, "Hello");
ret = stream->lpVtbl->Write(stream, data, 5, NULL); ret = stream->lpVtbl->Write(stream, data, 5, NULL);
if (mode == STGM_READ) if (mode == STGM_READ)
ok(ret == STG_E_ACCESSDENIED /* XP */ || ret == S_OK /* 2000 */, ok(ret == STG_E_ACCESSDENIED,
"expected STG_E_ACCESSDENIED or S_OK, got 0x%08x\n", ret); "expected STG_E_ACCESSDENIED, got 0x%08x\n", ret);
else else
ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret); ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret);
strcpy(data, "Hello"); strcpy(data, "Hello");
ret = stream->lpVtbl->Write(stream, data, 0, NULL); ret = stream->lpVtbl->Write(stream, data, 0, NULL);
if (mode == STGM_READ) if (mode == STGM_READ)
ok(ret == STG_E_ACCESSDENIED /* XP */ || ret == S_OK /* 2000 */, ok(ret == STG_E_ACCESSDENIED,
"expected STG_E_ACCESSDENIED or S_OK, got 0x%08x\n", ret); "expected STG_E_ACCESSDENIED, got 0x%08x\n", ret);
else else
ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret); ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret);
strcpy(data, "Hello"); strcpy(data, "Hello");
ret = stream->lpVtbl->Write(stream, data, 0, &count); ret = stream->lpVtbl->Write(stream, data, 0, &count);
if (mode == STGM_READ) if (mode == STGM_READ)
ok(ret == STG_E_ACCESSDENIED /* XP */ || ret == S_OK /* 2000 */, ok(ret == STG_E_ACCESSDENIED,
"expected STG_E_ACCESSDENIED or S_OK, got 0x%08x\n", ret); "expected STG_E_ACCESSDENIED, got 0x%08x\n", ret);
else else
ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret); ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret);
strcpy(data, "Hello"); strcpy(data, "Hello");
ret = stream->lpVtbl->Write(stream, data, 3, &count); ret = stream->lpVtbl->Write(stream, data, 3, &count);
if (mode == STGM_READ) if (mode == STGM_READ)
ok(ret == STG_E_ACCESSDENIED /* XP */ || ret == S_OK /* 2000 */, ok(ret == STG_E_ACCESSDENIED,
"expected STG_E_ACCESSDENIED or S_OK, got 0x%08x\n", ret); "expected STG_E_ACCESSDENIED, got 0x%08x\n", ret);
else else
ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret); ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret);
@ -119,8 +133,8 @@ static void test_IStream_invalid_operations(IStream * stream, DWORD mode)
ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret); ok(ret == S_OK, "expected S_OK, got 0x%08x\n", ret);
ret = IStream_Seek(stream, zero, 20, NULL); ret = IStream_Seek(stream, zero, 20, NULL);
ok(ret == E_INVALIDARG /* XP */ || ret == S_OK /* 2000 */, ok(ret == E_INVALIDARG,
"expected E_INVALIDARG or S_OK, got 0x%08x\n", ret); "expected E_INVALIDARG, got 0x%08x\n", ret);
/* IStream::CopyTo */ /* IStream::CopyTo */
@ -172,7 +186,7 @@ static void test_IStream_invalid_operations(IStream * stream, DWORD mode)
/* IStream::Stat */ /* IStream::Stat */
ret = IStream_Stat(stream, NULL, 0); ret = IStream_Stat(stream, NULL, 0);
ok(ret == STG_E_INVALIDPOINTER /* XP */ || ret == E_NOTIMPL /* 2000 */, ok(ret == STG_E_INVALIDPOINTER,
"expected STG_E_INVALIDPOINTER or E_NOTIMPL, got 0x%08x\n", ret); "expected STG_E_INVALIDPOINTER or E_NOTIMPL, got 0x%08x\n", ret);
/* IStream::Clone */ /* IStream::Clone */