[PATCH 1/2] d3drm/tests: Add tests for IDirect3DRM*::CreateObject.

Aaryaman Vasishta jem456.vasishta at gmail.com
Wed Apr 6 12:28:03 CDT 2016


On Mon, Apr 4, 2016 at 1:26 AM, Stefan Dösinger <stefandoesinger at gmail.com>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Hi,
>
> Some curiosities:
>
> Am 2016-04-03 um 20:04 schrieb Aaryaman Vasishta:
> > +    for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i)
> > +    {
> > +        hr = IDirect3DRM_CreateObject(d3drm1, tests[i].clsid, NULL,
> NULL, NULL);
> > +        todo_wine ok(hr == D3DRMERR_BADVALUE, "Test %u: expected hr ==
> D3DRMERR_BADVALUE, got %#x.\n", i, hr);
> What does clsid != NULL, refiid == NULL, output object != NULL do?
>
> I guess that clsid is the object you create, and iid is the interface to
> that object that is returned. So I guess in theory you can pass clsid =
> IDirect3DRMTexture3, iid = IDirect3DRMTexture and you'd get the same result
> as creating a d3drmtexture3 object and then calling QI(IDirect3DRMTexture).
> It might be worth adding explicit tests for this in future patches.
>
> The CLSID's defined in the headers are only for version 1 ones it seems.
So there's only one way to get a version 2/3 object i.e. from a version 1
CLSID.


>
> > +            ref2 = get_refcount((IUnknown *)d3drm1);
> > +            ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1
> = %u, ref2 = %u.\n", i, ref1, ref2);
> > +            IUnknown_Release(unknown);
> > +            ref2 = get_refcount((IUnknown *)d3drm1);
> > +            ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1
> = %u, ref2 = %u.\n", i, ref1, ref2);
> So what will increment the refcount? InitFrom*?
>
Right, InitFrom* increments the refcount. One more thing I've noticed (and
you can see that in my LoadTexture patch I sent a while ago) is that the
refcount is incremented even if the function fails.

>
> > +            hr = IDirect3DRM2_CreateObject(d3drm2, tests[i].clsid,
> NULL, tests[i].iid, (void **)&unknown);
> > +            ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got
> %#x.\n", i, hr);
> > +            ref2 = get_refcount((IUnknown *)d3drm1);
> > +            ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1
> = %u, ref2 = %u.\n", i, ref1, ref2);
> > +            ref3 = get_refcount((IUnknown *)d3drm2);
> > +            ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1
> = %u, ref3 = %u.\n", i, ref1, ref3);
> > ...
> > +
> > +            hr = IDirect3DRM3_CreateObject(d3drm3, tests[i].clsid,
> NULL, tests[i].iid, (void **)&unknown);
> > +            ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got
> %#x.\n", i, hr);
> > +            ref2 = get_refcount((IUnknown *)d3drm1);
> > +            ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1
> = %u, ref2 = %u.\n", i, ref1, ref2);
> > +            ref3 = get_refcount((IUnknown *)d3drm3);
> > +            ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1
> = %u, ref3 = %u.\n", i, ref1, ref3);
> Since you're testing the refcounts of 1,2 and 1,3 you might as well test
> the refcounts of all interfaces in all 3 versions.
>
>
Cheers,
> Stefan
>

Right, I'll add the new tests and submit a new patch.

Cheers,
Aaryaman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20160406/466f17aa/attachment.html>


More information about the wine-devel mailing list