[PATCH 1/2] d2d1/tests: Add some tests for compatible target size handling.

Henri Verbeet hverbeet at gmail.com
Thu Sep 27 17:03:01 CDT 2018


On 27 September 2018 at 17:47, Nikolay Sivov <nsivov at codeweavers.com> wrote:
> +static void test_compatible_target_size(ID2D1RenderTarget *rt)
> +{
> +    float dpi_x, dpi_y, rt_dpi_x, rt_dpi_y;
> +    ID2D1BitmapRenderTarget *bitmap_rt;
> +    ID2D1DeviceContext *context;
> +    D2D1_SIZE_U pixel_size;
> +    D2D1_SIZE_F size;
> +    HRESULT hr;
> +
> +    ID2D1RenderTarget_GetDpi(rt, &rt_dpi_x, &rt_dpi_y);
> +
> +    pixel_size.height = pixel_size.width = 0;
> +    hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, NULL, &pixel_size, NULL,
> +            D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &bitmap_rt);
> +todo_wine
> +    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
> +    if (FAILED(hr))
> +        return;
> +
I'd typically suggest to use ok_() for helpers like this one. In this
case, that doesn't help a lot for the "target dpi" tests though. Any
chance you could make those table-driven and then prefix the
ok-message with the index?



More information about the wine-devel mailing list