-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Am 2016-04-24 um 06:40 schrieb Aaryaman Vasishta:
> + size = 1;
> + hr = IDirect3DRMTexture_GetClassName(texture1, &size, cname);
> + ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
> + size = sizeof(cname);
> + hr = IDirect3DRMTexture_GetClassName(texture1, &size, cname);
> + ok(SUCCEEDED(hr), "Cannot get classname (hr = %x)\n", hr);
> + ok(size == sizeof("Texture"), "wrong size: %u\n", size);
sizeof("Texture") is confusing IMHO. I had to look up the C rules on
string literals to make sure it does what you want :-) . Though I'm not
sure if its better than strlen("Texture") + 1, so it's your call.
However, the current implementation in d3drm_texture3_GetClassName
confuses the two. I recommend adding a test for sizeof("Texture") - 1
and an exactly matching size.