Re: [PATCH 4/4] d3drm/tests: Add vtable comparison tests in test_frame_qi
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2015-04-02 um 18:36 schrieb Aaryaman Vasishta:
REFIID iid; REFIID refcount_iid; + REFIID vtable_iid; HRESULT hr; BOOL refcount_todo; + BOOL vtable_equal; + BOOL vtable_todo; };
I think this is more complicated than it needs to be. All you should need is the vtable_iid field. Then, in the inner loop do something like if (IsEqualGUID(tests[i].vtable_iid, tests[j].vtable_iid)) ok(iface1 == iface2, ...); else ok(iface1 != iface2, ...); I may be missing something though. If you want to compare two Win32 BOOLs for equality you have to be careful: BOOL a = 1; BOOL b = 2; if (a) printf("this is true.\n"); if (b) printf("this is also true.\n"); if (a == b) printf("oops, this is false.\n"); For something like that you can use if (!a == !b) printf("yay, this is true!\n"); IsEqualGUID(a, b) is defined as !memcmp(a, b, sizeof(GUID)), so IsEqualGUID() == (ptr1 == ptr2) should be OK though. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVHakvAAoJEN0/YqbEcdMwPPYP/08CiwYXURzl7Ias7EKvZGO8 QlYjp4CSEorj44LMOMPMELbN+50NJOngxhXA0mecIhZYA9Dgd5NZtVvDWBIPPu/B tXe+0+Xw/EvzubfzMYjOX5/lOKm400CW3fPEbxwYrzdFOSmeNhclZpfD+9jjuekG Lj2XUSk/TAi1B8NlD0x0LE7P6gGb61rg7jeJNZGgfPYMsuAoB2OtekvbIvpbCZmb 3WlOXtzmqVMHjsEsw47i8pdL/DwCFFfpE0xWWdhfgCChFUG/Ul/V56ltN5ERtudO j+jKtY5oNhunIyALwIifwhYNq/bY9CdfovIOI7sNfM3bXwSCZGEk+5Oq3/dnd4rP /Ejp+Kd5xk4SDMC3kyE6VucZkyFD58plgEDNlgSXx2ND/o3Mw91PTDaGj5xT0Fy1 Enk6oqORgXQhvtUaDH5Y5rOyh+AMquWhhN5N43ymT0UW40D4b6UBNSSwuQeqKaxS d1CqkbjUcivIBVd1k8GiuXEgjaEvwMlv8kPj1FGu/GCoMeyoRy7mXN1NOapPdFVu Gz2e8xR8Bri7oglvsS25i6gjYeYvP8qhTcc8tKBU2tr6MHFN3sUkuOZwtLKJLirc NxdSzaylgVGpCFQ0cwNSjm+eY0WvBd4eLychal+cs2plMmMAkYVTLDRBC4ZReCkw KIL1cdIMHQIZSSrDu22h =tKFs -----END PGP SIGNATURE-----
On Fri, Apr 3, 2015 at 2:10 AM, Stefan Dösinger <stefandoesinger(a)gmail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2015-04-02 um 18:36 schrieb Aaryaman Vasishta:
REFIID iid; REFIID refcount_iid; + REFIID vtable_iid; HRESULT hr; BOOL refcount_todo; + BOOL vtable_equal; + BOOL vtable_todo; };
I think this is more complicated than it needs to be. All you should need is the vtable_iid field. Then, in the inner loop do something like
if (IsEqualGUID(tests[i].vtable_iid, tests[j].vtable_iid)) ok(iface1 == iface2, ...); else ok(iface1 != iface2, ...);
I may be missing something though.
I've tried this and it works too. I'll use this on the patch try, and along with it also keep vtable_todo as some tests won't work on wine until they're fixed.
If you want to compare two Win32 BOOLs for equality you have to be careful:
BOOL a = 1; BOOL b = 2; if (a) printf("this is true.\n"); if (b) printf("this is also true.\n"); if (a == b) printf("oops, this is false.\n");
For something like that you can use if (!a == !b) printf("yay, this is true!\n");
IsEqualGUID(a, b) is defined as !memcmp(a, b, sizeof(GUID)), so IsEqualGUID() == (ptr1 == ptr2) should be OK though.
I'll keep this in mind the next time I come across it. Thank You!
jam
I realized that it might not be as easy as it seems to implement that approach - as including the todo's there is complicated. I've added another field called vtable_todo in the test, and done something like this, similar to how I did in the test_d3drm_qi tests: if (tables[i].vtable_todo || tables[j].vtable_todo) todo_wine ok(...); else ok(...); The problem with this approach is that if the tests fail on wine no matter what boolean combination I use. It's because we can't explicitly set which vtable should have a todo against another vtable in this case. If the vtable_todo is set to true for an entry, it'll do a todo_wine for every other interface it is checked against, which is undesirable and causes the fails or successful todo_wine(s). On Fri, Apr 3, 2015 at 2:41 AM, Aaryaman Vasishta <jem456.vasishta(a)gmail.com
wrote:
On Fri, Apr 3, 2015 at 2:10 AM, Stefan Dösinger <stefandoesinger(a)gmail.com
wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2015-04-02 um 18:36 schrieb Aaryaman Vasishta:
REFIID iid; REFIID refcount_iid; + REFIID vtable_iid; HRESULT hr; BOOL refcount_todo; + BOOL vtable_equal; + BOOL vtable_todo; };
I think this is more complicated than it needs to be. All you should need is the vtable_iid field. Then, in the inner loop do something like
if (IsEqualGUID(tests[i].vtable_iid, tests[j].vtable_iid)) ok(iface1 == iface2, ...); else ok(iface1 != iface2, ...);
I may be missing something though.
I've tried this and it works too. I'll use this on the patch try, and along with it also keep vtable_todo as some tests won't work on wine until they're fixed.
If you want to compare two Win32 BOOLs for equality you have to be careful:
BOOL a = 1; BOOL b = 2; if (a) printf("this is true.\n"); if (b) printf("this is also true.\n"); if (a == b) printf("oops, this is false.\n");
For something like that you can use if (!a == !b) printf("yay, this is true!\n");
IsEqualGUID(a, b) is defined as !memcmp(a, b, sizeof(GUID)), so IsEqualGUID() == (ptr1 == ptr2) should be OK though.
I'll keep this in mind the next time I come across it. Thank You!
jam
participants (2)
-
Aaryaman Vasishta -
Stefan Dösinger