Re: [PATCH 3/3] d3drm/tests: Add tests for IDirect3DRMTexture{2-3}_InitFromImage. (v2)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi, I think it'd be a good idea to add some lines testing InitFromImage on a texture that was created with CreateTexture and trying to call InitFromImage twice (with the first call succeeding). Am 2016-04-24 um 06:46 schrieb Aaryaman Vasishta:
+ /* InitFromImage tests */ + d3drm_img = NULL; + hr = IDirect3DRM2_CreateObject(d3drm2, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture2, (void **)&texture2); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture2 interface (hr = %x).\n", hr); + ref2 = get_refcount((IUnknown *)texture2); Did you forget IDirect3DRM::CreateObject(Texture1), or is there a reason why it is omitted?
+ hr = IDirect3DRMTexture2_InitFromImage(texture2, NULL); + todo_wine ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %x.\n", hr); + ref3 = get_refcount((IUnknown *)texture2); + ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3); You're not testing the reference count of d3drm1/2/3. My guess is that you plan to add this later since the InitFrom() increments it, and not the create. Is my understanding of your plans correct?
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXHJtCAAoJEN0/YqbEcdMwAhgQAJXR10NMu88OEslWcX2iUSSg rUXk7WcCaQVHHlGFwQwddtFLrX245idLScYxm8N9CvG3kyHxx91tQ3UH6wT+QHAv No6IuMc0menrh1g2mP08/Ci44sd7Hy01HS7K8A9+/rdwUnIhb3pYiAxB8673/7he ruXnPpYY/Mhi+8I1BAQA17qy5rArUFQWHGoth+18PnPdI9VELKlkZg0Y8R/ITqdu jgLkw1zKsKZS17qvwTyz+lyxmhC2mAjIMQu/WD/lVZOwXPTFUmSqPfUke6nyTFfA ffJL16e9C5CpyD+dCT+Rc3AUoboBo+JrQz4Qif4xOW+LhNY7fZeqt4f1Pd7+Zxqe X3sr7jVDTJY3d//bWy7eW1Ow7zixawhsWXa0cj6Z6TuIV4ruMvOK6QpZ2qb1IvmS BCTGoRI6DYF6bRDZLCirbz4nOB8CNTtO+erLhh5uHCP8wtN1eYC3/5rSjGjJACrT IBQ7g/l45/oiCkmVLug5kxUqgXXX0GoVbrod0MiBd0snDMwmev1T+xNHFdsfR9La 8AKBVF6eH3FqRo0Co6PGIvgKkk0ItuAUBPFkrvaREnzTwQO5XrSbCA54FeM8YFn3 FZH9ePNGENyWJD98SI1Laluw/9GiAusQynkJALSen9Aqm1pfhfH2OSuxaFqg0IfW vl8vPREqFJGtCGx9fQU/ =FjQh -----END PGP SIGNATURE-----
On Sun, Apr 24, 2016 at 3:39 PM, Stefan Dösinger <stefandoesinger(a)gmail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hi,
I think it'd be a good idea to add some lines testing InitFromImage on a texture that was created with CreateTexture and trying to call InitFromImage twice (with the first call succeeding).
Am 2016-04-24 um 06:46 schrieb Aaryaman Vasishta:
+ /* InitFromImage tests */ + d3drm_img = NULL; + hr = IDirect3DRM2_CreateObject(d3drm2, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture2, (void **)&texture2); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture2 interface (hr = %x).\n", hr); + ref2 = get_refcount((IUnknown *)texture2); Did you forget IDirect3DRM::CreateObject(Texture1), or is there a reason why it is omitted?
InitFromImage only exists for versions 2 and 3, so the tests for that were added accordingly, there wasn't any need for a CreateObject(Texture1) in this case.
+ hr = IDirect3DRMTexture2_InitFromImage(texture2, NULL); + todo_wine ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %x.\n", hr); + ref3 = get_refcount((IUnknown *)texture2); + ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3); You're not testing the reference count of d3drm1/2/3. My guess is that you plan to add this later since the InitFrom() increments it, and not the create. Is my understanding of your plans correct?
No you're right, I should've added refcount tests for d3drm1/2/3 as well. Even though InitFrom* is not implemented at this point, it's still a good idea to keep them as todo's and removing them when I send the implementation for InitFromImage. What do you think? InitFrom* does increment the refcount, whereas CreateObject doesn't seem to. I think it was meant to be like that as every object creatable by CreateObject has a corresponding init method, which I guess increments the refcount when called. I will resend this patch with the changes. Cheers, Aaryaman
participants (2)
-
Aaryaman Vasishta -
Stefan Dösinger