wined3d: Use wined3d_uint32_compare() in compare_sig().
[wine.git] / dlls / dpvoice / tests / voice.c
blob4b44e1e1081be1efaafad39c8c55713cb4c2b7ab
1 /*
2 * DirectPlay Voice Client Interface
4 * Copyright (C) 2014 Alistair Leslie-Hughes
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define WIN32_LEAN_AND_MEAN
22 #include <windows.h>
23 #include <stdio.h>
24 #include <assert.h>
26 #include <initguid.h>
27 #include <dplay8.h>
28 #include <dvoice.h>
29 #include "wine/test.h"
31 static IDirectPlayVoiceClient *vclient = NULL;
32 static IDirectPlayVoiceServer *vserver = NULL;
33 static IDirectPlay8Server *dpserver = NULL;
34 static IDirectPlay8Client *dpclient = NULL;
35 static BOOL HasConnected = FALSE;
36 static DWORD port = 8888;
37 static HANDLE connected = NULL;
39 static const GUID appguid = { 0xcd0c3d4b, 0xe15e, 0x4cf2, { 0x9e, 0xa8, 0x6e, 0x1d, 0x65, 0x48, 0xc5, 0xa6 } };
40 static WCHAR sessionname[] = L"winegamesserver";
43 static HRESULT WINAPI DirectPlayMessageHandler(void *lpvUserContext, DWORD dwMessageId, void *lpMessage)
45 trace("msgid: 0x%08x\n", dwMessageId);
46 return S_OK;
49 static HRESULT WINAPI DirectPlayClientMessageHandler(void *lpvUserContext, DWORD dwMessageId, void *lpMessage)
51 trace("cmsgid: 0x%08x\n", dwMessageId);
52 switch(dwMessageId)
54 case DPN_MSGID_CONNECT_COMPLETE:
56 PDPNMSG_CONNECT_COMPLETE completemsg;
57 completemsg = (PDPNMSG_CONNECT_COMPLETE)lpMessage;
59 trace("DPN_MSGID_CONNECT_COMPLETE code: 0x%08x\n", completemsg->hResultCode);
60 SetEvent(connected);
61 break;
65 return S_OK;
68 static HRESULT CALLBACK DirectPlayVoiceServerMessageHandler(void *lpvUserContext, DWORD dwMessageId, void *lpMessage)
70 trace("vserver: 0x%08x\n", dwMessageId);
71 return S_OK;
74 static HRESULT CALLBACK DirectPlayVoiceClientMessageHandler(void *lpvUserContext, DWORD dwMessageId, void *lpMessage)
76 trace("cserver: 0x%08x\n", dwMessageId);
78 return S_OK;
81 static BOOL test_init_dpvoice_server(void)
83 HRESULT hr;
85 hr = CoCreateInstance(&CLSID_DirectPlayVoiceServer, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlayVoiceServer, (void **)&vserver);
86 if(hr == S_OK)
88 DVSESSIONDESC dvSessionDesc;
89 IDirectPlay8Address *localaddr = NULL;
90 DPN_APPLICATION_DESC dpnAppDesc;
92 hr = CoCreateInstance(&CLSID_DirectPlay8Server, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlay8Server, (void **)&dpserver);
93 ok(hr == S_OK, "CoCreateInstance failed with 0x%08x\n", hr);
95 hr = IDirectPlay8Server_Initialize(dpserver, NULL, DirectPlayMessageHandler, 0);
96 ok(hr == S_OK, "Initialize failed with 0x%08x\n", hr);
98 hr = CoCreateInstance(&CLSID_DirectPlay8Address, NULL, CLSCTX_ALL, &IID_IDirectPlay8Address, (void **)&localaddr);
99 ok(hr == S_OK, "CoCreateInstance failed with 0x%08x\n", hr);
101 hr = IDirectPlay8Address_SetSP(localaddr, &CLSID_DP8SP_TCPIP);
102 ok(hr == S_OK, "SetSP with 0x%08x\n", hr);
104 hr = IDirectPlay8Address_AddComponent(localaddr, DPNA_KEY_HOSTNAME, L"localhost", sizeof(L"localhost"),
105 DPNA_DATATYPE_STRING );
106 ok(hr == S_OK, "AddComponent(addr) with 0x%08x\n", hr);
108 hr = IDirectPlay8Address_AddComponent(localaddr, DPNA_KEY_PORT, &port, sizeof(port), DPNA_DATATYPE_DWORD);
109 ok(hr == S_OK, "AddComponent(port)) with 0x%08x\n", hr);
111 memset(&dpnAppDesc, 0, sizeof(DPN_APPLICATION_DESC) );
112 dpnAppDesc.dwSize = sizeof( DPN_APPLICATION_DESC );
113 dpnAppDesc.dwFlags = DPNSESSION_CLIENT_SERVER;
114 dpnAppDesc.guidApplication = appguid;
115 dpnAppDesc.pwszSessionName = sessionname;
117 hr = IDirectPlay8Server_Host(dpserver, &dpnAppDesc, &localaddr, 1, NULL, NULL, NULL, 0 );
118 todo_wine ok(hr == S_OK, "Host failed with 0x%08x\n", hr);
120 hr = IDirectPlayVoiceServer_Initialize(vserver, NULL, &DirectPlayVoiceServerMessageHandler, NULL, 0, 0);
121 todo_wine ok(hr == DVERR_NOTRANSPORT, "Initialize failed with 0x%08x\n", hr);
123 hr = IDirectPlayVoiceServer_Initialize(vserver, (IUnknown*)dpserver, &DirectPlayVoiceServerMessageHandler, NULL, 0, 0);
124 todo_wine ok(hr == S_OK, "Initialize failed with 0x%08x\n", hr);
126 memset( &dvSessionDesc, 0, sizeof(DVSESSIONDESC) );
127 dvSessionDesc.dwSize = sizeof( DVSESSIONDESC );
128 dvSessionDesc.dwBufferAggressiveness = DVBUFFERAGGRESSIVENESS_DEFAULT;
129 dvSessionDesc.dwBufferQuality = DVBUFFERQUALITY_DEFAULT;
130 dvSessionDesc.dwFlags = 0;
131 dvSessionDesc.dwSessionType = DVSESSIONTYPE_MIXING;
132 dvSessionDesc.guidCT = DPVCTGUID_DEFAULT;
134 hr = IDirectPlayVoiceServer_StartSession(vserver, &dvSessionDesc, 0);
135 todo_wine ok(hr == S_OK, "StartSession failed with 0x%08x\n", hr);
137 if(localaddr)
138 IDirectPlay8Address_Release(localaddr);
140 else
142 /* Everything after Windows XP doesn't have dpvoice installed. */
143 win_skip("IDirectPlayVoiceServer not supported on this platform\n");
146 return vserver != NULL;
149 static BOOL test_init_dpvoice_client(void)
151 HRESULT hr;
152 WCHAR player[] = L"wineuser";
154 hr = CoCreateInstance(&CLSID_DirectPlayVoiceClient, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlayVoiceClient, (void **)&vclient);
155 if(hr == S_OK)
157 DVSOUNDDEVICECONFIG soundDeviceConfig;
158 DVCLIENTCONFIG clientConfig;
159 IDirectPlay8Address *localaddr = NULL;
160 IDirectPlay8Address *hostaddr = NULL;
161 DPN_PLAYER_INFO playerinfo;
162 DPN_APPLICATION_DESC appdesc;
163 DPNHANDLE asyncop;
165 connected = CreateEventA(NULL, FALSE, FALSE, NULL);
167 hr = CoCreateInstance(&CLSID_DirectPlay8Client, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlay8Client, (void **)&dpclient);
168 ok(hr == S_OK, "CoCreateInstance failed with 0x%08x\n", hr);
170 hr = IDirectPlay8Client_Initialize(dpclient, NULL, DirectPlayClientMessageHandler, 0);
171 ok(hr == S_OK, "Initialize failed with 0x%08x\n", hr);
173 hr = CoCreateInstance(&CLSID_DirectPlay8Address, NULL, CLSCTX_ALL, &IID_IDirectPlay8Address, (void **)&hostaddr);
174 ok(hr == S_OK, "CoCreateInstance failed with 0x%08x\n", hr);
176 hr = IDirectPlay8Address_SetSP(hostaddr, &CLSID_DP8SP_TCPIP);
177 ok(hr == S_OK, "SetSP with 0x%08x\n", hr);
179 hr = CoCreateInstance(&CLSID_DirectPlay8Address, NULL, CLSCTX_ALL, &IID_IDirectPlay8Address, (void **)&localaddr);
180 ok(hr == S_OK, "CoCreateInstance failed with 0x%08x\n", hr);
182 hr = IDirectPlay8Address_SetSP(localaddr, &CLSID_DP8SP_TCPIP);
183 ok(hr == S_OK, "SetSP with 0x%08x\n", hr);
185 hr = IDirectPlay8Address_AddComponent(hostaddr, DPNA_KEY_HOSTNAME, L"localhost", sizeof(L"localhost"),
186 DPNA_DATATYPE_STRING );
187 ok(hr == S_OK, "AddComponent(addr) with 0x%08x\n", hr);
189 hr = IDirectPlay8Address_AddComponent(hostaddr, DPNA_KEY_PORT, &port, sizeof(port), DPNA_DATATYPE_DWORD);
190 ok(hr == S_OK, "AddComponent(port)) with 0x%08x\n", hr);
192 memset( &playerinfo, 0, sizeof(DPN_PLAYER_INFO) );
193 playerinfo.dwSize = sizeof(DPN_PLAYER_INFO);
194 playerinfo.dwInfoFlags = DPNINFO_NAME;
195 playerinfo.pwszName = player;
197 hr = IDirectPlay8Client_SetClientInfo(dpclient, &playerinfo, NULL, NULL, DPNOP_SYNC);
198 ok(hr == S_OK, "SetClientInfo with 0x%08x\n", hr);
200 memset( &appdesc, 0, sizeof(DPN_APPLICATION_DESC));
201 appdesc.dwSize = sizeof( DPN_APPLICATION_DESC );
202 appdesc.guidApplication = appguid;
204 hr = IDirectPlay8Client_Connect(dpclient, &appdesc, hostaddr, localaddr, NULL, NULL, NULL, 0,
205 NULL, &asyncop, DPNCONNECT_OKTOQUERYFORADDRESSING);
206 ok(hr == S_OK || hr == DPNSUCCESS_PENDING, "Connect with 0x%08x\n", hr);
208 WaitForSingleObject(connected, 5000);
210 hr = IDirectPlayVoiceClient_Initialize(vclient, (IUnknown*)dpclient, DirectPlayVoiceClientMessageHandler, NULL, 0, 0 );
211 todo_wine ok(hr == S_OK, "Connect failed with 0x%08x\n", hr);
213 soundDeviceConfig.dwSize = sizeof(soundDeviceConfig);
214 soundDeviceConfig.dwFlags = 0;
215 soundDeviceConfig.guidPlaybackDevice = DSDEVID_DefaultVoicePlayback;
216 soundDeviceConfig.lpdsPlaybackDevice = NULL;
217 soundDeviceConfig.guidCaptureDevice = DSDEVID_DefaultVoiceCapture;
218 soundDeviceConfig.lpdsCaptureDevice = NULL;
219 soundDeviceConfig.hwndAppWindow = GetDesktopWindow();
220 soundDeviceConfig.lpdsMainBuffer = NULL;
221 soundDeviceConfig.dwMainBufferFlags = 0;
222 soundDeviceConfig.dwMainBufferPriority = 0;
224 memset(&clientConfig, 0, sizeof(clientConfig));
225 clientConfig.dwSize = sizeof(clientConfig);
226 clientConfig.dwFlags = DVCLIENTCONFIG_AUTOVOICEACTIVATED | DVCLIENTCONFIG_AUTORECORDVOLUME;
227 clientConfig.lPlaybackVolume = DVPLAYBACKVOLUME_DEFAULT;
228 clientConfig.dwBufferQuality = DVBUFFERQUALITY_DEFAULT;
229 clientConfig.dwBufferAggressiveness = DVBUFFERAGGRESSIVENESS_DEFAULT;
230 clientConfig.dwThreshold = DVTHRESHOLD_UNUSED;
231 clientConfig.lRecordVolume = DVRECORDVOLUME_LAST;
232 clientConfig.dwNotifyPeriod = 0;
234 /* Connect to the voice session */
235 hr = IDirectPlayVoiceClient_Connect(vclient, &soundDeviceConfig, &clientConfig, DVFLAGS_SYNC);
236 if(hr == DVERR_RUNSETUP)
238 IDirectPlayVoiceTest *voicetest;
240 /* See if we can get the default values from the registry and try again. */
241 hr = CoCreateInstance(&CLSID_DirectPlayVoiceTest, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlayVoiceTest, (void **)&voicetest);
242 ok(hr == S_OK, "CoCreateInstance failed with 0x%08x\n", hr);
243 if(hr == S_OK)
245 hr = IDirectPlayVoiceTest_CheckAudioSetup(voicetest, &DSDEVID_DefaultVoicePlayback, &DSDEVID_DefaultVoiceCapture,
246 NULL, DVFLAGS_QUERYONLY);
247 todo_wine ok(hr == S_OK || hr == DVERR_RUNSETUP, "CheckAudioSetup failed with 0x%08x\n", hr);
248 if(hr == S_OK)
250 hr = IDirectPlayVoiceClient_Connect(vclient, &soundDeviceConfig, &clientConfig, DVFLAGS_SYNC);
251 todo_wine ok(hr == S_OK, "Voice Connect failed with 0x%08x\n", hr);
253 else
255 win_skip("DirectPlayVoice not setup.\n");
258 IDirectPlayVoiceTest_Release(voicetest);
262 HasConnected = (hr == S_OK);
263 if(!HasConnected)
265 IDirectPlayVoiceClient_Release(vclient);
266 vclient = NULL;
269 if(hostaddr)
270 IDirectPlay8Address_Release(hostaddr);
272 if(localaddr)
273 IDirectPlay8Address_Release(localaddr);
275 CloseHandle(connected);
277 else
279 /* Everything after Windows XP doesn't have dpvoice installed. */
280 win_skip("IDirectPlayVoiceClient not supported on this platform\n");
283 return vclient != NULL;
286 static void test_cleanup_dpvoice(void)
288 HRESULT hr;
290 if(vclient)
292 if(HasConnected)
294 hr = IDirectPlayVoiceClient_Disconnect(vclient, 0);
295 todo_wine ok(hr == S_OK || hr == DV_PENDING, "Disconnect failed with 0x%08x\n", hr);
297 IDirectPlayVoiceClient_Release(vclient);
300 if(dpclient)
302 hr = IDirectPlay8Client_Close(dpclient, 0);
303 ok(hr == S_OK, "IDirectPlay8Client_Close failed with 0x%08x\n", hr);
305 IDirectPlay8Client_Release(dpclient);
308 if(vserver)
310 hr = IDirectPlayVoiceServer_StopSession(vserver, 0);
311 todo_wine ok(hr == S_OK, "StopSession failed with 0x%08x\n", hr);
313 IDirectPlayVoiceServer_Release(vserver);
316 if(dpserver)
318 hr = IDirectPlay8Server_Close(dpserver, 0);
319 todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
321 IDirectPlay8Server_Release(dpserver);
325 static void create_voicetest(void)
327 HRESULT hr;
328 IDirectPlayVoiceTest *voicetest;
330 hr = CoCreateInstance(&CLSID_DirectPlayVoiceTest, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlayVoiceTest, (void **)&voicetest);
331 if(hr == S_OK)
333 hr = IDirectPlayVoiceTest_CheckAudioSetup(voicetest, &DSDEVID_DefaultVoicePlayback, &DSDEVID_DefaultVoiceCapture,
334 NULL, DVFLAGS_QUERYONLY);
335 todo_wine ok(hr == S_OK || hr == DVERR_RUNSETUP, "CheckAudioSetup failed with 0x%08x\n", hr);
337 IDirectPlayVoiceTest_Release(voicetest);
339 else
341 /* Everything after Windows XP doesn't have dpvoice installed. */
342 win_skip("IDirectPlayVoiceClient not supported on this platform\n");
346 static void test_GetCompressionTypes(IDirectPlayVoiceClient *client_iface, IDirectPlayVoiceServer *server_iface)
348 const char *name = client_iface ? "client" : "server";
349 HRESULT ret;
350 DVCOMPRESSIONINFO data[32];
351 DWORD data_size = 0, num_elements, i, j;
352 WCHAR *string_loc;
353 BOOL found_pcm;
355 /* some variables are initialized to 99 just to check that they are not overwritten with 0 */
356 static struct
358 /* inputs */
359 DWORD data_size;
360 DWORD num_elements;
361 DWORD flags;
362 /* expected output */
363 HRESULT ret;
364 /* test flags */
365 enum
367 NULL_DATA = 1,
368 NULL_DATA_SIZE = 2,
369 NULL_NUM_ELEMENTS = 4,
370 SHARED_VARIABLE = 8
372 test_flags;
374 tests[] =
376 /* tests NULL data with an insufficient data_size */
377 { 10, 0, 0, DVERR_BUFFERTOOSMALL, NULL_DATA },
379 /* tests NULL data with an ample data_size */
380 { sizeof(data) - 1, 0, 0, DVERR_INVALIDPOINTER, NULL_DATA },
382 /* tests NULL data_size */
383 { 0, 99, 0, DVERR_INVALIDPOINTER, NULL_DATA_SIZE },
385 /* tests NULL num_elements */
386 { 99, 0, 0, DVERR_INVALIDPOINTER, NULL_NUM_ELEMENTS },
388 /* tests NULL everything */
389 { 99, 99, 0, DVERR_INVALIDPOINTER, NULL_DATA | NULL_DATA_SIZE | NULL_NUM_ELEMENTS },
391 /* tests passing the same pointer for data_size and num_elements */
392 { 10, 0, 0, DVERR_BUFFERTOOSMALL, SHARED_VARIABLE },
394 /* tests passing the same pointer but with an ample data_size */
395 { sizeof(data) - 1, 0, 0, DVERR_BUFFERTOOSMALL, SHARED_VARIABLE },
397 /* tests flags!=0 */
398 { 99, 99, 1, DVERR_INVALIDFLAGS },
400 /* tests data_size=0 */
401 { 0, 0, 0, DVERR_BUFFERTOOSMALL },
403 /* tests data_size=1 */
404 { 1, 0, 0, DVERR_BUFFERTOOSMALL },
406 /* tests data_size = sizeof(DVCOMPRESSIONINFO) */
407 { sizeof(DVCOMPRESSIONINFO), 0, 0, DVERR_BUFFERTOOSMALL },
409 /* tests data_size = returned data_size - 1 */
410 { 0 /* initialized later */, 0, 0, DVERR_BUFFERTOOSMALL },
412 /* tests data_size = returned data_size */
413 { 0 /* initialized later */, 0, 0, DV_OK },
415 /* tests data_size = returned data_size + 1 */
416 { 0 /* initialized later */, 0, 0, DV_OK }
419 /* either client_iface or server_iface must be given, but not both */
420 assert(!client_iface ^ !server_iface);
422 if (client_iface)
423 ret = IDirectPlayVoiceClient_GetCompressionTypes(client_iface, NULL, &data_size, &num_elements, 0);
424 else
425 ret = IDirectPlayVoiceServer_GetCompressionTypes(server_iface, NULL, &data_size, &num_elements, 0);
426 ok(ret == DVERR_BUFFERTOOSMALL,
427 "%s: expected ret=%x got ret=%x\n", name, DVERR_BUFFERTOOSMALL, ret);
428 ok(data_size > sizeof(DVCOMPRESSIONINFO) && data_size < sizeof(data) - 1,
429 "%s: got data_size=%u\n", name, data_size);
430 tests[ARRAY_SIZE(tests) - 3].data_size = data_size - 1;
431 tests[ARRAY_SIZE(tests) - 2].data_size = data_size;
432 tests[ARRAY_SIZE(tests) - 1].data_size = data_size + 1;
434 for(i = 0; i < ARRAY_SIZE(tests); i++)
436 memset(data, 0x23, sizeof(data));
438 data_size = tests[i].data_size;
439 num_elements = tests[i].num_elements;
441 if(client_iface)
442 ret = IDirectPlayVoiceClient_GetCompressionTypes(
443 client_iface,
444 tests[i].test_flags & NULL_DATA ? NULL : data,
445 tests[i].test_flags & NULL_DATA_SIZE ? NULL : &data_size,
446 tests[i].test_flags & NULL_NUM_ELEMENTS ? NULL :
447 tests[i].test_flags & SHARED_VARIABLE ? &data_size : &num_elements,
448 tests[i].flags
450 else
451 ret = IDirectPlayVoiceServer_GetCompressionTypes(
452 server_iface,
453 tests[i].test_flags & NULL_DATA ? NULL : data,
454 tests[i].test_flags & NULL_DATA_SIZE ? NULL : &data_size,
455 tests[i].test_flags & NULL_NUM_ELEMENTS ? NULL :
456 tests[i].test_flags & SHARED_VARIABLE ? &data_size : &num_elements,
457 tests[i].flags
460 ok(ret == tests[i].ret,
461 "%s: tests[%u]: expected ret=%x got ret=%x\n", name, i, tests[i].ret, ret);
463 if(ret == DV_OK || ret == DVERR_BUFFERTOOSMALL || tests[i].test_flags == NULL_DATA)
465 ok(data_size > sizeof(DVCOMPRESSIONINFO) && data_size < sizeof(data) - 1,
466 "%s: tests[%u]: got data_size=%u\n", name, i, data_size);
467 if(!(tests[i].test_flags & SHARED_VARIABLE))
468 ok(num_elements > 0 && num_elements < data_size / sizeof(DVCOMPRESSIONINFO) + 1,
469 "%s: tests[%u]: got num_elements=%u\n", name, i, num_elements);
471 else
473 ok(data_size == tests[i].data_size,
474 "%s: tests[%u]: expected data_size=%u got data_size=%u\n",
475 name, i, tests[i].data_size, data_size);
476 ok(num_elements == tests[i].num_elements,
477 "%s: tests[%u]: expected num_elements=%u got num_elements=%u\n",
478 name, i, tests[i].num_elements, num_elements);
481 if(ret == DV_OK)
483 string_loc = (WCHAR*)(data + num_elements);
484 found_pcm = FALSE;
485 for(j = 0; j < num_elements; j++)
487 if(memcmp(&data[j].guidType, &DPVCTGUID_NONE, sizeof(GUID)) == 0)
489 ok(data[j].dwMaxBitsPerSecond == 64000,
490 "%s: tests[%u]: data[%u]: expected dwMaxBitsPerSecond=64000 got dwMaxBitsPerSecond=%u\n",
491 name, i, j, data[j].dwMaxBitsPerSecond);
492 found_pcm = TRUE;
494 ok(data[j].dwSize == 80,
495 "%s: tests[%u]: data[%u]: expected dwSize=80 got dwSize=%u\n",
496 name, i, j, data[j].dwSize);
497 ok(data[j].lpszName == string_loc,
498 "%s: tests[%u]: data[%u]: expected lpszName=%p got lpszName=%p\n",
499 name, i, j, string_loc, data[j].lpszName);
500 ok(!data[j].lpszDescription,
501 "%s: tests[%u]: data[%u]: expected lpszDescription=NULL got lpszDescription=%s\n",
502 name, i, j, wine_dbgstr_w(data[j].lpszDescription));
503 ok(!data[j].dwFlags,
504 "%s: tests[%u]: data[%u]: expected dwFlags=0 got dwFlags=%u\n",
505 name, i, j, data[j].dwFlags);
506 string_loc += lstrlenW(data[j].lpszName) + 1;
508 ok((char*)string_loc == (char*)data + data_size,
509 "%s: tests[%u]: expected string_loc=%p got string_loc=%p\n",
510 name, i, (char*)data + data_size, string_loc);
511 ok(*(char*)string_loc == 0x23,
512 "%s: tests[%u]: expected *(char*)string_loc=0x23 got *(char*)string_loc=0x%x\n",
513 name, i, *(char*)string_loc);
514 ok(found_pcm, "%s: tests[%u]: MS-PCM codec not found\n", name, i);
516 else
518 ok(*(char*)data == 0x23,
519 "%s: tests[%u]: expected *(char*)data=0x23 got *(char*)data=0x%x\n",
520 name, i, *(char*)data);
525 START_TEST(voice)
527 HRESULT hr;
529 hr = CoInitialize(0);
530 ok(hr == S_OK, "failed to init com\n");
531 if(hr != S_OK)
532 return;
534 create_voicetest();
536 if(test_init_dpvoice_server())
538 test_GetCompressionTypes(NULL, vserver);
540 if(test_init_dpvoice_client())
542 test_GetCompressionTypes(vclient, NULL);
544 else
546 skip("client failed to initialize\n");
549 else
551 skip("server failed to initialize\n");
554 test_cleanup_dpvoice();
556 CoUninitialize();