[PATCH v3 2/3] d2d1/tests: Add tests for GetPropertyCount().

Ziqing Hui wine at gitlab.winehq.org
Wed Jun 29 00:04:42 CDT 2022


From: Ziqing Hui <zhui at codeweavers.com>

Signed-off-by: Ziqing Hui <zhui at codeweavers.com>
---
 dlls/d2d1/tests/d2d1.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index d31cd9cf1a3..51ed33701dc 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -11011,7 +11011,7 @@ static void test_effect_context(BOOL d3d11)
 
 static void test_effect_properties(BOOL d3d11)
 {
-    UINT32 i, min_inputs, max_inputs, integer, index;
+    UINT32 i, min_inputs, max_inputs, integer, index, property_count;
     ID2D1EffectContext *effect_context;
     D2D1_BUFFER_PRECISION precision;
     struct d2d1_test_context ctx;
@@ -11175,6 +11175,9 @@ static void test_effect_properties(BOOL d3d11)
     hr = ID2D1DeviceContext_CreateEffect(ctx.context, &CLSID_TestEffect, &effect);
     ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
+    property_count = ID2D1Effect_GetPropertyCount(effect);
+    ok(property_count == 2, "Got unexpected property count %u.\n", property_count);
+
     index = ID2D1Effect_GetPropertyIndex(effect, L"Context");
     ok(index == 0, "Got unexpected index %u.\n", index);
     index = ID2D1Effect_GetPropertyIndex(effect, L"Integer");
@@ -11257,12 +11260,12 @@ static void test_effect_properties(BOOL d3d11)
 
 static void test_effect_2d_affine(BOOL d3d11)
 {
+    unsigned int i, x, y, w, h, property_count;
     D2D1_MATRIX_3X2_F rotate, scale, skew;
     D2D1_BITMAP_PROPERTIES1 bitmap_desc;
     D2D_RECT_F output_bounds = {0};
     struct d2d1_test_context ctx;
     ID2D1DeviceContext *context;
-    unsigned int i, x, y, w, h;
     D2D1_SIZE_U input_size;
     ID2D1Factory1 *factory;
     D2D1_POINT_2F offset;
@@ -11341,6 +11344,9 @@ static void test_effect_2d_affine(BOOL d3d11)
 
     check_system_properties(effect, TRUE);
 
+    property_count = ID2D1Effect_GetPropertyCount(effect);
+    todo_wine ok(property_count == 4, "Got unexpected property count %u.\n", property_count);
+
     for (i = 0; i < ARRAY_SIZE(effect_2d_affine_tests); ++i)
     {
         const struct effect_2d_affine_test *test = &effect_2d_affine_tests[i];
@@ -11406,6 +11412,7 @@ static void test_effect_2d_affine(BOOL d3d11)
 static void test_effect_crop(BOOL d3d11)
 {
     D2D1_BITMAP_PROPERTIES1 bitmap_desc;
+    unsigned int i, property_count;
     struct d2d1_test_context ctx;
     ID2D1DeviceContext *context;
     D2D_RECT_F output_bounds;
@@ -11415,7 +11422,6 @@ static void test_effect_crop(BOOL d3d11)
     DWORD image[16 * 16];
     ID2D1Effect *effect;
     ID2D1Image *output;
-    unsigned int i;
     HRESULT hr;
 
     const struct crop_effect_test
@@ -11453,6 +11459,9 @@ static void test_effect_crop(BOOL d3d11)
 
     check_system_properties(effect, TRUE);
 
+    property_count = ID2D1Effect_GetPropertyCount(effect);
+    todo_wine ok(property_count == 2, "Got unexpected property count %u.\n", property_count);
+
     for (i = 0; i < ARRAY_SIZE(crop_effect_tests); ++i)
     {
         const struct crop_effect_test *test = &crop_effect_tests[i];
@@ -11497,6 +11506,7 @@ static void test_effect_grayscale(BOOL d3d11)
 {
     DWORD colour, expected_colour, luminance;
     D2D1_BITMAP_PROPERTIES1 bitmap_desc;
+    unsigned int i, property_count;
     struct d2d1_test_context ctx;
     struct resource_readback rb;
     ID2D1DeviceContext *context;
@@ -11505,7 +11515,6 @@ static void test_effect_grayscale(BOOL d3d11)
     ID2D1Bitmap1 *bitmap;
     ID2D1Effect *effect;
     ID2D1Image *output;
-    unsigned int i;
     HRESULT hr;
 
     const DWORD test_pixels[] = {0xffffffff, 0x12345678, 0x89abcdef, 0x77777777, 0xdeadbeef};
@@ -11528,6 +11537,9 @@ static void test_effect_grayscale(BOOL d3d11)
 
     check_system_properties(effect, TRUE);
 
+    property_count = ID2D1Effect_GetPropertyCount(effect);
+    ok(property_count == 0, "Got unexpected property count %u.\n", property_count);
+
     for (i = 0; i < ARRAY_SIZE(test_pixels); ++i)
     {
         DWORD pixel = test_pixels[i];
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/330



More information about the wine-devel mailing list