-----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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXHJxZAAoJEN0/YqbEcdMwMAkP/0JEXejefj/awhnJGh5zQlg9 07gvcDjH+KvsHYbJsWOA8GE3+JcUJrqpHA8nqO2Uxmy1mg26EECNtRFTjfWJ4oQM iHcVgVurTb6rx6UZpcLkoy/BQ4fvWQFtWxfL2J9ZDO2TVt+0oeGSurkv5ywylTmq 5RZa5lFhnaeMyWw6hbtXNwsPXMhi+tDdHZTYVakJGRa72deO23ZrWuzbHzMfnlDx /SnGnSnFF9JcWLkLQMqeiQ+Q2Ztn+PHo15EjAye3hk1gvVYKx5xx7+Hef9l4/1dG Cqc2I+4GwE86FmrBkqT1noF6HDo4+6evHi+JrW6d0WFH7I/k3D+5SUtaqtBRtraC AuS4Kwsqri4wpVeqz6zsX8BsneQHQzkB87EXEC81d7W6fTPAYT1YoQp2zDPxP32G lIwd3bxtdyYA91dNTCGx8arKEpBXhuKqh0ahI8FrRBiuZ20JVIvosiVBxpWHYsiV 9X3smnaiYrL6sZTPtbcHbcs5shbuycpzm05EB5noSbc+P6ur5/q4Q9nSH86OYAIr mJBZWg6pE9N1zcko6KTmB//z7NGYms8knxVQYGVgtRgZaNk8+mVaeedgdbnrIMFj xsdTX8UGtOAs7mJ6E496xq4P7bMxK5B0BSoChtaJV3ZeS9wLD/JId/1Z7l/DvVwn 0EDb2DPmwv7EbEWz7cAH =MI19 -----END PGP SIGNATURE-----