Module: wine Branch: master Commit: 17a64c4450f4fdb24279278894b1922cdba727af URL: http://source.winehq.org/git/wine.git/?a=commit;h=17a64c4450f4fdb24279278894...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Wed Jun 13 18:30:46 2012 +0900
windowscodecs: Add a test to show that metadata reader may not rewind the stream after loading the data.
---
dlls/windowscodecs/tests/metadata.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c index a4f9ad1..6b25963 100644 --- a/dlls/windowscodecs/tests/metadata.c +++ b/dlls/windowscodecs/tests/metadata.c @@ -142,6 +142,8 @@ static void load_stream(IUnknown *reader, const char *data, int data_size) HRESULT hr; IWICPersistStream *persist; IStream *stream; + LARGE_INTEGER pos; + ULARGE_INTEGER cur_pos;
stream = create_stream(data, data_size); if (!stream) @@ -158,6 +160,13 @@ static void load_stream(IUnknown *reader, const char *data, int data_size) IWICPersistStream_Release(persist); }
+ pos.QuadPart = 0; + hr = IStream_Seek(stream, pos, SEEK_CUR, &cur_pos); + ok(hr == S_OK, "IStream_Seek error %#x\n", hr); + /* IFD metadata reader doesn't rewind the stream to the start */ + ok(cur_pos.QuadPart == 0 || cur_pos.QuadPart <= data_size, + "current stream pos is at %x/%x, data size %x\n", cur_pos.u.LowPart, cur_pos.u.HighPart, data_size); + IStream_Release(stream); }