From: Ziqing Hui Subject: [PATCH 2/5] d2d1/tests: Add tests for GetPropertyCount(). Message-Id: <20220622113500.30789-2-zhui@codeweavers.com> Date: Wed, 22 Jun 2022 19:34:57 +0800 In-Reply-To: <20220622113500.30789-1-zhui@codeweavers.com> References: <20220622113500.30789-1-zhui@codeweavers.com> Signed-off-by: Ziqing Hui --- dlls/d2d1/tests/d2d1.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 68d2716a118..b144571fb90 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -10312,7 +10312,7 @@ static void test_mt_factory(BOOL d3d11) static void test_builtin_effect(BOOL d3d11) { - unsigned int i, j, min_inputs, max_inputs, str_size, input_count, value_size; + unsigned int i, j, min_inputs, max_inputs, str_size, input_count, value_size, property_count; D2D1_BITMAP_PROPERTIES bitmap_desc; D2D1_BUFFER_PRECISION precision; ID2D1Image *image_a, *image_b; @@ -10333,18 +10333,19 @@ static void test_builtin_effect(BOOL d3d11) { const CLSID *clsid; UINT32 factory_version; + UINT32 property_count; UINT32 default_input_count; UINT32 min_inputs; UINT32 max_inputs; } effect_tests[] = { - {&CLSID_D2D12DAffineTransform, 1, 1, 1, 1}, - {&CLSID_D2D13DPerspectiveTransform, 1, 1, 1, 1}, - {&CLSID_D2D1Composite, 1, 2, 1, 0xffffffff}, - {&CLSID_D2D1Crop, 1, 1, 1, 1}, - {&CLSID_D2D1Shadow, 1, 1, 1, 1}, - {&CLSID_D2D1Grayscale, 3, 1, 1, 1}, + {&CLSID_D2D12DAffineTransform, 1, 4, 1, 1, 1}, + {&CLSID_D2D13DPerspectiveTransform, 1, 8, 1, 1, 1}, + {&CLSID_D2D1Composite, 1, 1, 2, 1, 0xffffffff}, + {&CLSID_D2D1Crop, 1, 2, 1, 1, 1}, + {&CLSID_D2D1Shadow, 1, 3, 1, 1, 1}, + {&CLSID_D2D1Grayscale, 3, 0, 1, 1, 1}, }; const struct property_test @@ -10403,6 +10404,12 @@ static void test_builtin_effect(BOOL d3d11) ID2D1Image_Release(image_b); ID2D1Image_Release(image_a); + /* Test property count */ + property_count = ID2D1Effect_GetPropertyCount(effect); + todo_wine_if(test->property_count != 0) + ok(property_count == test->property_count, "Got unexpected property count %u, expected %u.\n", + property_count, test->property_count); + /* Test system property name, type, value size */ for (j = 0; j < ARRAY_SIZE(property_tests); ++j) { @@ -11008,7 +11015,7 @@ done: 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; @@ -11174,6 +11181,9 @@ static void test_effect_properties(BOOL d3d11) if (hr != S_OK) goto done; + 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"); -- 2.25.1