[PATCH 2/2] windowscodecs: Implement DdsDecoder_Initialize().
DDS file layout can been found here: https://docs.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-p... Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> --- dlls/windowscodecs/ddsformat.c | 81 +++++++++++++++++++++++++++- dlls/windowscodecs/tests/ddsformat.c | 4 +- 2 files changed, 81 insertions(+), 4 deletions(-)
Ziqing Hui <zhui(a)codeweavers.com> wrote:
--- a/dlls/windowscodecs/tests/ddsformat.c +++ b/dlls/windowscodecs/tests/ddsformat.c @@ -86,9 +86,9 @@ static HRESULT init_decoder(IWICBitmapDecoder *decoder, IWICStream *stream, HRES
hr = IWICBitmapDecoder_Initialize(decoder, (IStream*)stream, WICDecodeMetadataCacheOnDemand); if (index == -1) { - todo_wine ok(SUCCEEDED(hr), "Decoder Initialize failed, hr=%x\n", hr); + ok(SUCCEEDED(hr), "Decoder Initialize failed, hr=%x\n", hr); } else { - todo_wine ok(hr == expected, "%d: Expected hr=%x, got %x\n", index, expected, hr); + ok(hr == expected, "%d: Expected hr=%x, got %x\n", index, expected, hr); } return hr; }
Please avoid using SUCCEEDED() in the tests, it's a very bad style. SUCCEEDED() macro may hide the bugs and in most cases is meaningless. Always explicitly test for S_OK instead. -- Dmitry.
Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> I think checking SUCCEEDED is OK in this case because we have an exact check later. The first one just determines whether the decoder works and further tests can be run.
participants (3)
-
Dmitry Timoshkov -
Esme Povirk (they/them) -
Ziqing Hui