[PATCH v4 2/2] uiautomationcore: Expand UiaHostProviderFromHwnd wine tests.

Connor McAdams cmcadams at codeweavers.com
Mon Sep 27 08:43:45 CDT 2021


On Sun, Sep 26, 2021 at 12:40:00PM +0300, Nikolay Sivov wrote:
> 
> 
> On 9/25/21 2:01 AM, Connor McAdams wrote:
> > +    hr = IRawElementProviderSimple_GetPropertyValue(p, UIA_NativeWindowHandlePropertyId, &v);
> > +    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
> > +    ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
> > +    ok(V_I4(&v) == (INT)hwnd, "V_I4(&v) = %#x\n", V_I4(&v));
> This should use same casting macro that you're using in implementation now.
> 
> > +    hr = IRawElementProviderSimple_GetPropertyValue(p, UIA_ProviderDescriptionPropertyId, &v);
> > +    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
> > +    ok(V_VT(&v) == VT_BSTR, "V_VT(&v) = %d\n", V_VT(&v));
> > +    SysFreeString(V_BSTR(&v));
> VariantClear() is more appropriate here.
> 
> > +    /* No patterns are implemented on the HWND provider. */
> > +    for (i = 10000; i < 10034; i++)
> > +    {
> > +        IUnknown *unk;
> > +
> > +        unk = NULL;
> > +        hr = IRawElementProviderSimple_GetPatternProvider(p, i, &unk);
> > +        ok(hr == S_OK, "Unexpected hr %#x, %d.\n", hr, i);
> > +        ok(!unk, "Pattern %d returned %p\n", i, unk);
> > +    }
> I'm only curious, does this particular index range has some defined
> meaning that you need to test all of it?
>
> Note that "unk" check doesn't tell you if pointer was reset by this method.
>

Yeah, this index range is the range of UIA_InvokePatternId through the
last defined UIA_CustomNavigationPatternId. I could add definitions for
these in the headers, I was just trying to avoid adding extra data that
really doesn't get used per se in this patch. But it probably makes
sense to just add the definitions for these into the headers.

Thanks for the review. I'll fix these things and send in a v5.



More information about the wine-devel mailing list