comctl32/tests: Remove excessive error handling logic.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
fa4820c203
commit
111acb1597
|
@ -1517,26 +1517,22 @@ static void test_ImageList_DrawIndirect(void)
|
|||
|
||||
hbmMask = CreateBitmap(2, 1, 1, 1, &maskBits);
|
||||
ok(hbmMask != 0, "CreateBitmap failed\n");
|
||||
if(!hbmMask) goto cleanup;
|
||||
|
||||
hbmInverseMask = CreateBitmap(2, 1, 1, 1, &inverseMaskBits);
|
||||
ok(hbmInverseMask != 0, "CreateBitmap failed\n");
|
||||
if(!hbmInverseMask) goto cleanup;
|
||||
|
||||
himl = pImageList_Create(2, 1, ILC_COLOR32, 0, 1);
|
||||
ok(himl != 0, "ImageList_Create failed\n");
|
||||
if(!himl) goto cleanup;
|
||||
|
||||
hr = pHIMAGELIST_QueryInterface(himl, &IID_IImageList, (void **) &imgl);
|
||||
ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr);
|
||||
|
||||
/* Add a no-alpha image */
|
||||
hbmImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_image);
|
||||
if(!hbmImage) goto cleanup;
|
||||
ok(hbmImage != NULL, "Failed to create test bitmap.\n");
|
||||
|
||||
iImage = pImageList_Add(himl, hbmImage, hbmMask);
|
||||
ok(iImage != -1, "ImageList_Add failed\n");
|
||||
if(iImage == -1) goto cleanup;
|
||||
|
||||
hr = IImageList_GetItemFlags(imgl, 1000, &flags);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
|
@ -1550,11 +1546,10 @@ static void test_ImageList_DrawIndirect(void)
|
|||
|
||||
/* Add an alpha image */
|
||||
hbmAlphaImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_alpha);
|
||||
if(!hbmAlphaImage) goto cleanup;
|
||||
ok(hbmAlphaImage != NULL, "Failed to create test bitmap.\n");
|
||||
|
||||
iAlphaImage = pImageList_Add(himl, hbmAlphaImage, hbmMask);
|
||||
ok(iAlphaImage != -1, "ImageList_Add failed\n");
|
||||
if(iAlphaImage == -1) goto cleanup;
|
||||
|
||||
hr = IImageList_GetItemFlags(imgl, iAlphaImage, &flags);
|
||||
ok(hr == S_OK, "Failed to get item flags, hr %#x.\n", hr);
|
||||
|
@ -1562,11 +1557,10 @@ static void test_ImageList_DrawIndirect(void)
|
|||
|
||||
/* Add a transparent alpha image */
|
||||
hbmTransparentImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_transparent);
|
||||
if(!hbmTransparentImage) goto cleanup;
|
||||
ok(hbmTransparentImage != NULL, "Failed to create test bitmap.\n");
|
||||
|
||||
iTransparentImage = pImageList_Add(himl, hbmTransparentImage, hbmMask);
|
||||
ok(iTransparentImage != -1, "ImageList_Add failed\n");
|
||||
if(iTransparentImage == -1) goto cleanup;
|
||||
|
||||
hr = IImageList_GetItemFlags(imgl, iTransparentImage, &flags);
|
||||
ok(hr == S_OK, "Failed to get item flags, hr %#x.\n", hr);
|
||||
|
@ -1576,8 +1570,6 @@ static void test_ImageList_DrawIndirect(void)
|
|||
bitmapInfo.bmiHeader.biBitCount = 32;
|
||||
hbmDst = CreateDIBSection(hdcDst, &bitmapInfo, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
|
||||
ok (hbmDst && bits, "CreateDIBSection failed to return a valid bitmap and buffer\n");
|
||||
if (!hbmDst || !bits)
|
||||
goto cleanup;
|
||||
hbmOld = SelectObject(hdcDst, hbmDst);
|
||||
|
||||
check_ImageList_DrawIndirect_fStyle(hdcDst, himl, bits, iImage, ILD_NORMAL, 0x00ABCDEF, __LINE__);
|
||||
|
@ -1630,24 +1622,19 @@ static void test_ImageList_DrawIndirect(void)
|
|||
bitmapInfo.bmiHeader.biHeight = -4;
|
||||
hbmDst = CreateDIBSection(hdcDst, &bitmapInfo, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
|
||||
ok (hbmDst && bits, "CreateDIBSection failed to return a valid bitmap and buffer\n");
|
||||
if (!hbmDst || !bits) goto cleanup;
|
||||
SelectObject(hdcDst, hbmDst);
|
||||
|
||||
hbm4x4 = create_test_bitmap(hdcDst, 4, 4, 32, bits_4x4);
|
||||
if (!hbm4x4) goto cleanup;
|
||||
ok(hbm4x4 != NULL, "Failed to create a test bitmap.\n");
|
||||
|
||||
ret = pImageList_SetIconSize(himl, 4, 4);
|
||||
ok(ret, "ImageList_SetIconSize failed\n");
|
||||
if (!ret) goto cleanup;
|
||||
|
||||
ret = pImageList_Add(himl, hbm4x4, NULL);
|
||||
ok(ret != -1, "ImageList_Add failed\n");
|
||||
if(ret == -1) goto cleanup;
|
||||
|
||||
check_ImageList_DrawIndirect_grayscale(hdcDst, himl, bits, bits_4x4, 0, 4, 4, __LINE__);
|
||||
|
||||
cleanup:
|
||||
|
||||
if(hbmOld)
|
||||
SelectObject(hdcDst, hbmOld);
|
||||
if(hbmDst)
|
||||
|
|
Loading…
Reference in New Issue