Commit b9bfcf2c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw/tests: Get rid of some unused assignments.

parent d8135b82
/*
* Copyright 2011-2012 Henri Verbeet for CodeWeavers
* Copyright 2011-2014 Henri Verbeet for CodeWeavers
* Copyright 2012-2013 Stefan Dösinger for CodeWeavers
*
* This library is free software; you can redistribute it and/or
......@@ -304,7 +304,7 @@ static IDirect3DDevice *create_device(IDirectDraw *ddraw, HWND window, DWORD coo
U2(surface_desc).dwZBufferBitDepth = z_depths[i];
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
if (FAILED(hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &ds, NULL)))
if (FAILED(IDirectDraw_CreateSurface(ddraw, &surface_desc, &ds, NULL)))
continue;
hr = IDirectDrawSurface_AddAttachedSurface(surface, ds);
......@@ -313,7 +313,7 @@ static IDirect3DDevice *create_device(IDirectDraw *ddraw, HWND window, DWORD coo
if (FAILED(hr))
continue;
if (SUCCEEDED(hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DHALDevice, (void **)&device)))
if (SUCCEEDED(IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DHALDevice, (void **)&device)))
break;
IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
......@@ -3990,14 +3990,13 @@ static void test_primary_palette(void)
0, 0, 640, 480, 0, 0, 0, 0);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (FAILED(hr = IDirectDraw_SetDisplayMode(ddraw, 640, 480, 8)))
if (FAILED(IDirectDraw_SetDisplayMode(ddraw, 640, 480, 8)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDraw_Release(ddraw);
DestroyWindow(window);
return;
}
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
......@@ -5179,7 +5178,7 @@ static void test_palette_gdi(void)
refcount = IDirectDrawSurface_Release(surface);
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
if (FAILED(hr = IDirectDraw_SetDisplayMode(ddraw, 640, 480, 8)))
if (FAILED(IDirectDraw_SetDisplayMode(ddraw, 640, 480, 8)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDrawPalette_Release(palette);
......@@ -5351,14 +5350,13 @@ static void test_palette_alpha(void)
0, 0, 640, 480, 0, 0, 0, 0);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (FAILED(hr = IDirectDraw_SetDisplayMode(ddraw, 640, 480, 8)))
if (FAILED(IDirectDraw_SetDisplayMode(ddraw, 640, 480, 8)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDraw_Release(ddraw);
DestroyWindow(window);
return;
}
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
......
/*
* Copyright 2011-2012 Henri Verbeet for CodeWeavers
* Copyright 2011-2014 Henri Verbeet for CodeWeavers
* Copyright 2012-2014 Stefan Dösinger for CodeWeavers
*
* This library is free software; you can redistribute it and/or
......@@ -236,7 +236,7 @@ static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD c
U2(surface_desc).dwZBufferBitDepth = z_depths[i];
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
if (FAILED(hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &ds, NULL)))
if (FAILED(IDirectDraw2_CreateSurface(ddraw, &surface_desc, &ds, NULL)))
continue;
hr = IDirectDrawSurface_AddAttachedSurface(surface, ds);
......@@ -245,7 +245,7 @@ static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD c
if (FAILED(hr))
continue;
if (SUCCEEDED(hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device)))
if (SUCCEEDED(IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device)))
break;
IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
......@@ -835,7 +835,7 @@ static void test_surface_interface_mismatch(void)
goto cleanup;
}
if (FAILED(hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirect3D2, (void **)&d3d)))
if (FAILED(IDirectDraw2_QueryInterface(ddraw, &IID_IDirect3D2, (void **)&d3d)))
{
skip("D3D interface is not available, skipping test.\n");
goto cleanup;
......@@ -3940,7 +3940,7 @@ static void test_rt_caps(void)
ok(!!z_depth, "Failed to get device z depth.\n");
IDirect3DDevice2_Release(device);
if (FAILED(hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirect3D2, (void **)&d3d)))
if (FAILED(IDirectDraw2_QueryInterface(ddraw, &IID_IDirect3D2, (void **)&d3d)))
{
skip("D3D interface is not available, skipping test.\n");
goto done;
......@@ -5066,14 +5066,13 @@ static void test_primary_palette(void)
0, 0, 640, 480, 0, 0, 0, 0);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (FAILED(hr = IDirectDraw2_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
if (FAILED(IDirectDraw2_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDraw2_Release(ddraw);
DestroyWindow(window);
return;
}
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
......@@ -6247,7 +6246,7 @@ static void test_palette_gdi(void)
refcount = IDirectDrawSurface_Release(surface);
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
if (FAILED(hr = IDirectDraw2_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
if (FAILED(IDirectDraw2_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDrawPalette_Release(palette);
......@@ -6420,14 +6419,13 @@ static void test_palette_alpha(void)
0, 0, 640, 480, 0, 0, 0, 0);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (FAILED(hr = IDirectDraw2_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
if (FAILED(IDirectDraw2_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDraw2_Release(ddraw);
DestroyWindow(window);
return;
}
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
......
/*
* Copyright 2011-2012 Henri Verbeet for CodeWeavers
* Copyright 2011-2014 Henri Verbeet for CodeWeavers
* Copyright 2012-2014 Stefan Dösinger for CodeWeavers
*
* This library is free software; you can redistribute it and/or
......@@ -1031,7 +1031,7 @@ static void test_surface_interface_mismatch(void)
hr = IDirectDrawSurface4_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3);
ok(SUCCEEDED(hr), "Failed to QI IDirectDrawSurface3, hr %#x.\n", hr);
if (FAILED(hr = IDirectDraw4_QueryInterface(ddraw, &IID_IDirect3D3, (void **)&d3d)))
if (FAILED(IDirectDraw4_QueryInterface(ddraw, &IID_IDirect3D3, (void **)&d3d)))
{
skip("D3D interface is not available, skipping test.\n");
goto cleanup;
......@@ -4689,7 +4689,7 @@ static void test_rt_caps(void)
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
if (FAILED(hr = IDirectDraw4_QueryInterface(ddraw, &IID_IDirect3D3, (void **)&d3d)))
if (FAILED(IDirectDraw4_QueryInterface(ddraw, &IID_IDirect3D3, (void **)&d3d)))
{
skip("D3D interface is not available, skipping test.\n");
goto done;
......@@ -5052,7 +5052,7 @@ static void test_surface_lock(void)
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
if (FAILED(hr = IDirectDraw4_QueryInterface(ddraw, &IID_IDirect3D3, (void **)&d3d)))
if (FAILED(IDirectDraw4_QueryInterface(ddraw, &IID_IDirect3D3, (void **)&d3d)))
{
skip("D3D interface is not available, skipping test.\n");
goto done;
......@@ -5847,14 +5847,13 @@ static void test_primary_palette(void)
0, 0, 640, 480, 0, 0, 0, 0);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (FAILED(hr = IDirectDraw4_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
if (FAILED(IDirectDraw4_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDraw4_Release(ddraw);
DestroyWindow(window);
return;
}
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
......@@ -7245,7 +7244,7 @@ static void test_palette_gdi(void)
refcount = IDirectDrawSurface4_Release(surface);
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
if (FAILED(hr = IDirectDraw4_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
if (FAILED(IDirectDraw4_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDrawPalette_Release(palette);
......@@ -7417,14 +7416,13 @@ static void test_palette_alpha(void)
0, 0, 640, 480, 0, 0, 0, 0);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (FAILED(hr = IDirectDraw4_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
if (FAILED(IDirectDraw4_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDraw4_Release(ddraw);
DestroyWindow(window);
return;
}
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
......
/*
* Copyright 2006, 2012-2014 Stefan Dösinger for CodeWeavers
* Copyright 2011 Henri Verbeet for CodeWeavers
* Copyright 2011-2014 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -948,7 +948,7 @@ static void test_surface_interface_mismatch(void)
hr = IDirectDrawSurface7_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3);
ok(SUCCEEDED(hr), "Failed to QI IDirectDrawSurface3, hr %#x.\n", hr);
if (FAILED(hr = IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d)))
if (FAILED(IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d)))
{
skip("D3D interface is not available, skipping test.\n");
goto cleanup;
......@@ -4460,7 +4460,7 @@ static void test_rt_caps(void)
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
if (FAILED(hr = IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d)))
if (FAILED(IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d)))
{
skip("D3D interface is not available, skipping test.\n");
goto done;
......@@ -4868,7 +4868,7 @@ static void test_surface_lock(void)
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
if (FAILED(hr = IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d)))
if (FAILED(IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d)))
{
skip("D3D interface is not available, skipping test.\n");
goto done;
......@@ -5688,14 +5688,13 @@ static void test_primary_palette(void)
0, 0, 640, 480, 0, 0, 0, 0);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (FAILED(hr = IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
if (FAILED(IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDraw7_Release(ddraw);
DestroyWindow(window);
return;
}
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
......@@ -5823,7 +5822,7 @@ static void test_surface_attachment(void)
U2(surface_desc).dwMipMapCount = 3;
surface_desc.dwWidth = 128;
surface_desc.dwHeight = 128;
if (FAILED(hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface1, NULL)))
if (FAILED(IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface1, NULL)))
{
skip("Failed to create a texture, skipping tests.\n");
IDirectDraw7_Release(ddraw);
......@@ -6967,7 +6966,7 @@ static void test_palette_gdi(void)
refcount = IDirectDrawSurface7_Release(surface);
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
if (FAILED(hr = IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
if (FAILED(IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDrawPalette_Release(palette);
......@@ -7139,14 +7138,13 @@ static void test_palette_alpha(void)
0, 0, 640, 480, 0, 0, 0, 0);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (FAILED(hr = IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
if (FAILED(IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
{
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
IDirectDraw7_Release(ddraw);
DestroyWindow(window);
return;
}
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment