From b34d4bdcb80fefa9bf49a93a0b1592ae2efeb5e3 Mon Sep 17 00:00:00 2001 From: Ziqing Hui Date: Mon, 20 Apr 2020 12:00:18 +0800 Subject: [PATCH] windowscodecs/tests: Avoid using SUCCEEDED() and FAILED() in ddsformat.c. Signed-off-by: Ziqing Hui Signed-off-by: Vincent Povirk Signed-off-by: Alexandre Julliard --- dlls/windowscodecs/tests/ddsformat.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c index 0d8e728abcc..ddb20e7b635 100644 --- a/dlls/windowscodecs/tests/ddsformat.c +++ b/dlls/windowscodecs/tests/ddsformat.c @@ -45,12 +45,12 @@ static IWICStream *create_stream(const void *image_data, UINT image_size) IWICStream *stream = NULL; hr = IWICImagingFactory_CreateStream(factory, &stream); - ok(SUCCEEDED(hr), "CreateStream failed, hr=%x\n", hr); - if (FAILED(hr)) goto fail; + ok(hr == S_OK, "CreateStream failed, hr=%x\n", hr); + if (hr != S_OK) goto fail; hr = IWICStream_InitializeFromMemory(stream, (BYTE *)image_data, image_size); - ok(SUCCEEDED(hr), "InitializeFromMemory failed, hr=%x\n", hr); - if (FAILED(hr)) goto fail; + ok(hr == S_OK, "InitializeFromMemory failed, hr=%x\n", hr); + if (hr != S_OK) goto fail; return stream; @@ -67,14 +67,14 @@ static IWICBitmapDecoder *create_decoder(void) hr = CoCreateInstance(&CLSID_WICDdsDecoder, NULL, CLSCTX_INPROC_SERVER, &IID_IWICBitmapDecoder, (void **)&decoder); - if (FAILED(hr)) { + if (hr != S_OK) { win_skip("Dds decoder is not supported\n"); return NULL; } memset(&guidresult, 0, sizeof(guidresult)); hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult); - ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%x\n", hr); + ok(hr == S_OK, "GetContainerFormat failed, hr=%x\n", hr); ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatDds), "Unexpected container format\n"); return decoder; @@ -86,7 +86,7 @@ static HRESULT init_decoder(IWICBitmapDecoder *decoder, IWICStream *stream, HRES hr = IWICBitmapDecoder_Initialize(decoder, (IStream*)stream, WICDecodeMetadataCacheOnDemand); if (index == -1) { - ok(SUCCEEDED(hr), "Decoder Initialize failed, hr=%x\n", hr); + ok(hr == S_OK, "Decoder Initialize failed, hr=%x\n", hr); } else { ok(hr == expected, "%d: Expected hr=%x, got %x\n", index, expected, hr); } @@ -200,7 +200,7 @@ static void test_dds_decoder(void) if (!decoder) goto end; hr = init_decoder(decoder, stream, S_OK, -1); - if (FAILED(hr)) goto end; + if (hr != S_OK) goto end; test_dds_decoder_initialize(); test_dds_decoder_global_properties(decoder); @@ -217,8 +217,8 @@ START_TEST(ddsformat) hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IWICImagingFactory, (void **)&factory); - ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr); - if (FAILED(hr)) goto end; + ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr); + if (hr != S_OK) goto end; test_dds_decoder();