Re: [1/2] dpnet: Add IDirectPlay8Client tests
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2014-05-05 08:46, schrieb Alistair Leslie-Hughes:
+static IDirectPlay8Client* client = NULL; ... + hr = CoCreateInstance(&CLSID_DirectPlay8Client, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlay8Client, (void **)&client); + ok(hr == S_OK, "CoCreateInstance failed with 0x%x\n", hr); ... + hr = IDirectPlay8Client_Close(client, 0); + ok(hr == S_OK, "IDirectPlay8Client_Close failed with %x\n", hr); Please avoid such dependencies between different tests. If creating and releasing the client is something that every test has to do you can add helper functions for this task.
+ for (i=0;i<items;i++) + { + trace("Found Service Provider: %s\n", wine_dbgstr_w(serv_prov_info->pwszName)); + trace("Found guid: %s\n", wine_dbgstr_guid(&serv_prov_info->guid)); + + serv_prov_info++; + } + + serv_prov_info -= items; /* set pointer back */ + ok(HeapFree(GetProcessHeap(), 0, serv_prov_info), "Failed freeing server provider info\n"); You could use serv_prov_info as an array instead of doing the pointer arithmentic twice. E.g.
trace("Found guid: %s\n", wine_dbgstr_guid(&serv_prov_info[i].guid));
+ hr = IDirectPlay8Client_EnumHosts(client, &appdesc, host, local, NULL, 0, INFINITE, 0, INFINITE, NULL, &async, 0); + todo_wine ok(hr == DPNSUCCESS_PENDING, "IDirectPlay8Client_EnumServiceProviders failed with 0x%08x\n", hr); + todo_wine ok(async, "No Handle returned\n"); + + hr = IDirectPlay8Client_CancelAsyncOperation(client, async, 0); + ok(hr == S_OK, "IDirectPlay8Client_CancelAsyncOperation failed with 0x%08x\n", hr); Are you sure that this always returns DPNSUCCESS_PENDING? Couldn't it also return a result instantly? Overall I don't see the point in this test at the moment. As it is now it doesn't say much. This is just an opinion though, I'll leave the decision up to you.
+ todo_wine ok(caps.dwMaxEnumPayloadSize == 983, "expected 983, got %d\n", caps.dwMaxEnumPayloadSize); Out of curiosity, do you have any idea where this value comes from? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJTaTX9AAoJEN0/YqbEcdMwB6AP/jd1T0OLGPXO3pgF9boIHp6i yQTDCgf7Wq8zKJuxDZtOzfGzVbYqVeN8TDx9c3oD3RSru9bBIJ9Bjeu3hKqvL2Qo 4JRJZyQn665RymbKo/S9ivXBHmd9cuh4tfdTxHU7n0nVXICCNDniBxfAwr2HkkeB iyvMe8Ga3SPVCL+33XZAniPPFnfnEYkaqU42CTUUK2hlYyzb4bScihgdrUqoX36k RtvK2UKxOBT5E9nd0VIS/b8fF4uXFIzD7M6oEuzLObXL6XGsRNl2mtMpZ0ztlFpy PIF1AbFyK4tQA3obsTSWUVJVlQFLCurvqg2klLogewdyVy4wE4h0/oOCRCPhuVbR baJf0by5ZC4Os4YIZIzN0OOy0N3A+bMQI1VdvQTuMPwF+dYk268p0t77SN6F2gfa ts9MyQxYrhrao3+oI4Hw2ouYUxIYj+WxNSVCb01TjUrMVOMAeD1Ksttbk1g5ADdZ +DbV9CWuOhISjXh5OT8ToH0FxrImrby3FDyX/UFf2KPzwzKoX2kNyjtSHguPIOko 3jOnuVh8HsD7jX0sQqMMkdwsESdfTCwIHXLhbE4C08yxsu8ByNhFHme3oX4EcyPf oHRUA+w8Yr8rr+wSU1fpPEb79ZnMn5xfR7xZQKzX5af0ICta6k3UjtSeAuE6P1xX HFJrTsoKGibhnm6z2wZH =sF7u -----END PGP SIGNATURE-----
Please avoid such dependencies between different tests. If creating and releasing the client is something that every test has to do you can add helper functions for this task. A usual approach is to only have a single client, so I've changed the init function to fail if we don't have a client pointer.
+ hr = IDirectPlay8Client_CancelAsyncOperation(client, async, 0); + ok(hr == S_OK, "IDirectPlay8Client_CancelAsyncOperation failed with 0x%08x\n", hr); Are you sure that this always returns DPNSUCCESS_PENDING? Couldn't it also return a result instantly? Overall I don't see the point in this test at the moment. As it is now it doesn't say much. This is just an opinion though, I'll leave the decision up to you. Since we are running asynchronously, this is the default return value.
+ todo_wine ok(caps.dwMaxEnumPayloadSize == 983, "expected 983, got %d\n", caps.dwMaxEnumPayloadSize); Out of curiosity, do you have any idea where this value comes from?
No, I don't know where these value come from. However they seem to be same between windows versions. Best Regards Alistair Leslie-Hughes
participants (2)
-
Alistair Leslie-Hughes -
Stefan Dösinger