Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/mfplat/tests/mfplat.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 541459c715b..1b51cd73dc3 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -1947,8 +1947,10 @@ static void test_file_stream(void) WCHAR pathW[MAX_PATH]; DWORD caps, count; WCHAR *filename; + BYTE data[8]; HRESULT hr; WCHAR *str; + ULONG size; BOOL eos;
filename = load_resource(L"test.mp4"); @@ -2023,6 +2025,31 @@ static void test_file_stream(void) ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(position == 2 * bytestream_length, "Unexpected position.\n");
+ hr = IMFByteStream_IsEndOfStream(bytestream, &eos); + ok(hr == S_OK, "Failed query end of stream, hr %#x.\n", hr); + ok(eos == TRUE, "Unexpected IsEndOfStream result, %u.\n", eos); + + size = 0xdeadbeef; + hr = IMFByteStream_Read(bytestream, data, sizeof(data), &size); + todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_HANDLE_EOF), "Unexpected hr %#x.\n", hr); + todo_wine ok(size == 0xdeadbeef, "Got size %u.\n", size); + + hr = IMFByteStream_SetCurrentPosition(bytestream, bytestream_length - 4); + ok(hr == S_OK, "Failed to set bytestream position, hr %#x.\n", hr); + + size = 0xdeadbeef; + hr = IMFByteStream_Read(bytestream, data, sizeof(data), &size); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(size == 4, "Got size %u.\n", size); + + hr = IMFByteStream_SetCurrentPosition(bytestream, bytestream_length); + ok(hr == S_OK, "Failed to set bytestream position, hr %#x.\n", hr); + + size = 0xdeadbeef; + hr = IMFByteStream_Read(bytestream, data, sizeof(data), &size); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!size, "Got size %u.\n", size); + hr = MFCreateFile(MF_ACCESSMODE_READ, MF_OPENMODE_FAIL_IF_NOT_EXIST, MF_FILEFLAGS_NONE, filename, &bytestream2); ok(hr == S_OK, "got 0x%08x\n", hr);