Commit 6d7bd62a authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

winmm/tests: Compile with -D__WINESRC__.

parent 36638ef5
TESTDLL = winmm.dll TESTDLL = winmm.dll
IMPORTS = winmm user32 advapi32 IMPORTS = winmm user32 advapi32
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \ C_SRCS = \
capture.c \ capture.c \
......
...@@ -43,9 +43,9 @@ static const char * wave_in_error(MMRESULT error) ...@@ -43,9 +43,9 @@ static const char * wave_in_error(MMRESULT error)
static char long_msg[1100]; static char long_msg[1100];
MMRESULT rc; MMRESULT rc;
rc = waveInGetErrorText(error, msg, sizeof(msg)); rc = waveInGetErrorTextA(error, msg, sizeof(msg));
if (rc != MMSYSERR_NOERROR) if (rc != MMSYSERR_NOERROR)
sprintf(long_msg, "waveInGetErrorText(%x) failed with error %x", error, rc); sprintf(long_msg, "waveInGetErrorTextA(%x) failed with error %x", error, rc);
else else
sprintf(long_msg, "%s(%s)", mmsys_error(error), msg); sprintf(long_msg, "%s(%s)", mmsys_error(error), msg);
return long_msg; return long_msg;
...@@ -127,7 +127,8 @@ static void check_position(int device, HWAVEIN win, DWORD bytes, ...@@ -127,7 +127,8 @@ static void check_position(int device, HWAVEIN win, DWORD bytes,
dev_name(device)); dev_name(device));
} }
static void wave_in_test_deviceIn(int device, LPWAVEFORMATEX pwfx, DWORD format, DWORD flags, LPWAVEINCAPS pcaps) static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format, DWORD flags,
WAVEINCAPSA *pcaps)
{ {
HWAVEIN win; HWAVEIN win;
HANDLE hevent = CreateEventW(NULL, FALSE, FALSE, NULL); HANDLE hevent = CreateEventW(NULL, FALSE, FALSE, NULL);
......
...@@ -30,12 +30,12 @@ ...@@ -30,12 +30,12 @@
static MCIERROR ok_saved = MCIERR_FILE_NOT_FOUND; static MCIERROR ok_saved = MCIERR_FILE_NOT_FOUND;
typedef union { typedef union {
MCI_INFO_PARMS info; MCI_INFO_PARMSA info;
MCI_STATUS_PARMS status; MCI_STATUS_PARMS status;
MCI_WAVE_SET_PARMS set; MCI_WAVE_SET_PARMS set;
MCI_WAVE_OPEN_PARMS open; MCI_WAVE_OPEN_PARMSA open;
MCI_GETDEVCAPS_PARMS caps; MCI_GETDEVCAPS_PARMS caps;
MCI_SYSINFO_PARMS sys; MCI_SYSINFO_PARMSA sys;
MCI_SEEK_PARMS seek; MCI_SEEK_PARMS seek;
MCI_GENERIC_PARMS gen; MCI_GENERIC_PARMS gen;
} MCI_PARMS_UNION; } MCI_PARMS_UNION;
...@@ -412,8 +412,8 @@ static void test_openCloseWAVE(HWND hwnd) ...@@ -412,8 +412,8 @@ static void test_openCloseWAVE(HWND hwnd)
ok(!err,"mci close shareable returned %s\n", dbg_mcierr(err)); ok(!err,"mci close shareable returned %s\n", dbg_mcierr(err));
} }
err = mciGetDeviceID("waveaudio"); err = mciGetDeviceIDA("waveaudio");
ok(err==0,"mciGetDeviceID waveaudio returned %u, expected 0\n", err); ok(!err, "mciGetDeviceIDA waveaudio returned %u, expected 0\n", err);
err = mciSendStringA(command_open, buf, sizeof(buf), hwnd); err = mciSendStringA(command_open, buf, sizeof(buf), hwnd);
ok(!err,"mci %s returned %s\n", command_open, dbg_mcierr(err)); ok(!err,"mci %s returned %s\n", command_open, dbg_mcierr(err));
...@@ -527,8 +527,8 @@ static void test_openCloseWAVE(HWND hwnd) ...@@ -527,8 +527,8 @@ static void test_openCloseWAVE(HWND hwnd)
ok(err==MCIERR_UNRECOGNIZED_KEYWORD || broken(err==MMSYSERR_NOTSUPPORTED/* Win9x */), "mciCommand MCI_INFO other: %s\n", dbg_mcierr(err)); ok(err==MCIERR_UNRECOGNIZED_KEYWORD || broken(err==MMSYSERR_NOTSUPPORTED/* Win9x */), "mciCommand MCI_INFO other: %s\n", dbg_mcierr(err));
ok(!strcmp(buf,"K"), "info output buffer %s\n", buf); ok(!strcmp(buf,"K"), "info output buffer %s\n", buf);
err = mciGetDeviceID("all"); err = mciGetDeviceIDA("all");
ok(MCI_ALL_DEVICE_ID==err || /* Win9x */(WORD)MCI_ALL_DEVICE_ID==err,"mciGetDeviceID all returned %u, expected %d\n", err, MCI_ALL_DEVICE_ID); ok(err == MCI_ALL_DEVICE_ID, "mciGetDeviceIDA all returned %u, expected MCI_ALL_DEVICE_ID\n", err);
err = mciSendStringA(command_close_my, NULL, 0, hwnd); err = mciSendStringA(command_close_my, NULL, 0, hwnd);
ok(!err,"mci %s returned %s\n", command_close_my, dbg_mcierr(err)); ok(!err,"mci %s returned %s\n", command_close_my, dbg_mcierr(err));
...@@ -596,8 +596,8 @@ static void test_openCloseWAVE(HWND hwnd) ...@@ -596,8 +596,8 @@ static void test_openCloseWAVE(HWND hwnd)
ok(0xDEADF00D==intbuf[0] && 0xABADCAFE==intbuf[2],"DWORD buffer corruption\n"); ok(0xDEADF00D==intbuf[0] && 0xABADCAFE==intbuf[2],"DWORD buffer corruption\n");
err = mciGetDeviceID("waveaudio"); err = mciGetDeviceIDA("waveaudio");
ok(err==1,"mciGetDeviceID waveaudio returned %u, expected 0\n", err); ok(err == 1, "mciGetDeviceIDA waveaudio returned %u, expected 1\n", err);
err = mciSendStringA("open no-such-file.wav alias waveaudio", buf, sizeof(buf), NULL); err = mciSendStringA("open no-such-file.wav alias waveaudio", buf, sizeof(buf), NULL);
ok(err==MCIERR_DUPLICATE_ALIAS, "mci open alias waveaudio returned %s\n", dbg_mcierr(err)); ok(err==MCIERR_DUPLICATE_ALIAS, "mci open alias waveaudio returned %s\n", dbg_mcierr(err));
...@@ -638,12 +638,12 @@ static void test_recordWAVE(HWND hwnd) ...@@ -638,12 +638,12 @@ static void test_recordWAVE(HWND hwnd)
ok(!err,"mciCommand open new type waveaudio alias x notify: %s\n", dbg_mcierr(err)); ok(!err,"mciCommand open new type waveaudio alias x notify: %s\n", dbg_mcierr(err));
wDeviceID = parm.open.wDeviceID; wDeviceID = parm.open.wDeviceID;
err = mciGetDeviceID("x"); err = mciGetDeviceIDA("x");
ok(err==wDeviceID,"mciGetDeviceID x returned %u, expected %u\n", err, wDeviceID); ok(err == wDeviceID, "mciGetDeviceIDA x returned %u, expected %u\n", err, wDeviceID);
/* Only the alias is looked up. */ /* Only the alias is looked up. */
err = mciGetDeviceID("waveaudio"); err = mciGetDeviceIDA("waveaudio");
ok(err==0,"mciGetDeviceID waveaudio returned %u, expected 0\n", err); ok(!err, "mciGetDeviceIDA waveaudio returned %u, expected 0\n", err);
test_notification(hwnd, "open new", MCI_NOTIFY_SUCCESSFUL); test_notification(hwnd, "open new", MCI_NOTIFY_SUCCESSFUL);
test_notification(hwnd, "open new no #2", 0); test_notification(hwnd, "open new no #2", 0);
...@@ -771,8 +771,9 @@ static void test_recordWAVE(HWND hwnd) ...@@ -771,8 +771,9 @@ static void test_recordWAVE(HWND hwnd)
if(!err) ok_saved = 0; if(!err) ok_saved = 0;
/* Save must not rename the original file. */ /* Save must not rename the original file. */
if (!DeleteFile("tempfile1.wav")) if (!DeleteFileA("tempfile1.wav"))
todo_wine ok(FALSE, "Save must not rename the original file; DeleteFile returned %d\n", GetLastError()); todo_wine ok(FALSE, "Save must not rename the original file; DeleteFileA returned %d\n",
GetLastError());
err = mciSendStringA("set x channels 2", NULL, 0, NULL); err = mciSendStringA("set x channels 2", NULL, 0, NULL);
ok(err==MCIERR_NONAPPLICABLE_FUNCTION,"mci set channels after saving returned %s\n", dbg_mcierr(err)); ok(err==MCIERR_NONAPPLICABLE_FUNCTION,"mci set channels after saving returned %s\n", dbg_mcierr(err));
...@@ -807,14 +808,14 @@ static void test_playWAVE(HWND hwnd) ...@@ -807,14 +808,14 @@ static void test_playWAVE(HWND hwnd)
return; return;
} }
err = mciGetDeviceID("mysound"); err = mciGetDeviceIDA("mysound");
ok(err==1,"mciGetDeviceID mysound returned %u, expected 1\n", err); ok(err == 1, "mciGetDeviceIDA mysound returned %u, expected 1\n", err);
err = mciGetDeviceID("tempfile.wav"); err = mciGetDeviceIDA("tempfile.wav");
ok(err==0,"mciGetDeviceID tempfile.wav returned %u, expected 0\n", err); ok(!err, "mciGetDeviceIDA tempfile.wav returned %u, expected 0\n", err);
err = mciGetDeviceID("waveaudio"); err = mciGetDeviceIDA("waveaudio");
ok(err==0,"mciGetDeviceID waveaudio returned %u, expected 0\n", err); ok(!err, "mciGetDeviceIDA waveaudio returned %u, expected 0\n", err);
err = mciSendStringA("status mysound length", buf, sizeof(buf), NULL); err = mciSendStringA("status mysound length", buf, sizeof(buf), NULL);
ok(!err,"mci status length returned %s\n", dbg_mcierr(err)); ok(!err,"mci status length returned %s\n", dbg_mcierr(err));
...@@ -949,15 +950,15 @@ static void test_asyncWAVE(HWND hwnd) ...@@ -949,15 +950,15 @@ static void test_asyncWAVE(HWND hwnd)
ok(wDeviceID,"mci open DeviceID: %d\n", wDeviceID); ok(wDeviceID,"mci open DeviceID: %d\n", wDeviceID);
test_notification(hwnd,"open alias notify",MCI_NOTIFY_SUCCESSFUL); test_notification(hwnd,"open alias notify",MCI_NOTIFY_SUCCESSFUL);
err = mciGetDeviceID("mysound"); err = mciGetDeviceIDA("mysound");
ok(err==wDeviceID,"mciGetDeviceID alias returned %u, expected %u\n", err, wDeviceID); ok(err == wDeviceID, "mciGetDeviceIDA alias returned %u, expected %u\n", err, wDeviceID);
/* Only the alias is looked up. */ /* Only the alias is looked up. */
err = mciGetDeviceID("tempfile.wav"); err = mciGetDeviceIDA("tempfile.wav");
ok(err==0,"mciGetDeviceID tempfile.wav returned %u, expected 0\n", err); ok(!err, "mciGetDeviceIDA tempfile.wav returned %u, expected 0\n", err);
err = mciGetDeviceID("waveaudio"); err = mciGetDeviceIDA("waveaudio");
ok(err==0,"mciGetDeviceID waveaudio returned %u, expected 0\n", err); ok(!err, "mciGetDeviceIDA waveaudio returned %u, expected 0\n", err);
err = mciSendStringA("status mysound mode", buf, sizeof(buf), hwnd); err = mciSendStringA("status mysound mode", buf, sizeof(buf), hwnd);
ok(!err,"mci status mode returned %s\n", dbg_mcierr(err)); ok(!err,"mci status mode returned %s\n", dbg_mcierr(err));
...@@ -1195,8 +1196,8 @@ static void test_AutoOpenWAVE(HWND hwnd) ...@@ -1195,8 +1196,8 @@ static void test_AutoOpenWAVE(HWND hwnd)
if(!err) ok(!strcmp(buf,"tempfile.wav"), "sysinfo name 1 open: %s\n", buf); if(!err) ok(!strcmp(buf,"tempfile.wav"), "sysinfo name 1 open: %s\n", buf);
test_notification(hwnd, "sysinfo name notify\n", MCI_NOTIFY_SUCCESSFUL); test_notification(hwnd, "sysinfo name notify\n", MCI_NOTIFY_SUCCESSFUL);
err = mciGetDeviceID("tempfile.wav"); err = mciGetDeviceIDA("tempfile.wav");
ok(err==1,"mciGetDeviceID tempfile.wav returned %u, expected 1\n", err); ok(err == 1, "mciGetDeviceIDA tempfile.wav returned %u, expected 1\n", err);
/* Save the full pathname to the file. */ /* Save the full pathname to the file. */
err = mciSendStringA("info tempfile.wav file", path, sizeof(path), NULL); err = mciSendStringA("info tempfile.wav file", path, sizeof(path), NULL);
...@@ -1312,6 +1313,6 @@ START_TEST(mci) ...@@ -1312,6 +1313,6 @@ START_TEST(mci)
/* Win9X hangs when exiting with something still open. */ /* Win9X hangs when exiting with something still open. */
err = mciSendStringA("close all", NULL, 0, hwnd); err = mciSendStringA("close all", NULL, 0, hwnd);
ok(!err,"final close all returned %s\n", dbg_mcierr(err)); ok(!err,"final close all returned %s\n", dbg_mcierr(err));
ok(DeleteFile("tempfile.wav")||ok_saved,"Delete tempfile.wav (cause auto-open?)\n"); ok(DeleteFileA("tempfile.wav") || ok_saved, "Delete tempfile.wav (cause auto-open?)\n");
DestroyWindow(hwnd); DestroyWindow(hwnd);
} }
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
typedef union { typedef union {
MCI_STATUS_PARMS status; MCI_STATUS_PARMS status;
MCI_GETDEVCAPS_PARMS caps; MCI_GETDEVCAPS_PARMS caps;
MCI_OPEN_PARMS open; MCI_OPEN_PARMSA open;
MCI_PLAY_PARMS play; MCI_PLAY_PARMS play;
MCI_SEEK_PARMS seek; MCI_SEEK_PARMS seek;
MCI_SAVE_PARMS save; MCI_SAVE_PARMSA save;
MCI_GENERIC_PARMS gen; MCI_GENERIC_PARMS gen;
} MCI_PARMS_UNION; } MCI_PARMS_UNION;
......
...@@ -266,10 +266,9 @@ const char* wave_out_error(MMRESULT error) ...@@ -266,10 +266,9 @@ const char* wave_out_error(MMRESULT error)
static char long_msg[1100]; static char long_msg[1100];
MMRESULT rc; MMRESULT rc;
rc = waveOutGetErrorText(error, msg, sizeof(msg)); rc = waveOutGetErrorTextA(error, msg, sizeof(msg));
if (rc != MMSYSERR_NOERROR) if (rc != MMSYSERR_NOERROR)
sprintf(long_msg, "waveOutGetErrorText(%x) failed with error %x", sprintf(long_msg, "waveOutGetErrorTextA(%x) failed with error %x", error, rc);
error, rc);
else else
sprintf(long_msg, "%s(%s)", mmsys_error(error), msg); sprintf(long_msg, "%s(%s)", mmsys_error(error), msg);
return long_msg; return long_msg;
...@@ -574,12 +573,12 @@ static DWORD WINAPI callback_thread(LPVOID lpParameter) ...@@ -574,12 +573,12 @@ static DWORD WINAPI callback_thread(LPVOID lpParameter)
PeekMessageW( &msg, 0, 0, 0, PM_NOREMOVE ); /* make sure the thread has a message queue */ PeekMessageW( &msg, 0, 0, 0, PM_NOREMOVE ); /* make sure the thread has a message queue */
SetEvent(lpParameter); SetEvent(lpParameter);
while (GetMessage(&msg, 0, 0, 0)) { while (GetMessageA(&msg, 0, 0, 0)) {
UINT message = msg.message; UINT message = msg.message;
/* for some reason XP sends a WM_USER message before WOM_OPEN */ /* for some reason XP sends a WM_USER message before WOM_OPEN */
ok (message == WOM_OPEN || message == WOM_DONE || ok (message == WOM_OPEN || message == WOM_DONE ||
message == WOM_CLOSE || message == WM_USER || message == WM_APP, message == WOM_CLOSE || message == WM_USER || message == WM_APP,
"GetMessage returned unexpected message: %u\n", message); "GetMessageA returned unexpected message: %u\n", message);
if (message == WOM_OPEN || message == WOM_DONE || message == WOM_CLOSE) if (message == WOM_OPEN || message == WOM_DONE || message == WOM_CLOSE)
SetEvent(lpParameter); SetEvent(lpParameter);
else if (message == WM_APP) { else if (message == WM_APP) {
...@@ -591,11 +590,9 @@ static DWORD WINAPI callback_thread(LPVOID lpParameter) ...@@ -591,11 +590,9 @@ static DWORD WINAPI callback_thread(LPVOID lpParameter)
return 0; return 0;
} }
static void wave_out_test_deviceOut(int device, double duration, static void wave_out_test_deviceOut(int device, double duration, int headers, int loops,
int headers, int loops, WAVEFORMATEX *pwfx, DWORD format, DWORD flags, WAVEOUTCAPSA *pcaps, BOOL interactive,
LPWAVEFORMATEX pwfx, DWORD format, BOOL sine, BOOL pause)
DWORD flags, LPWAVEOUTCAPS pcaps,
BOOL interactive, BOOL sine, BOOL pause)
{ {
HWAVEOUT wout; HWAVEOUT wout;
HANDLE hevent = CreateEventW(NULL, FALSE, FALSE, NULL); HANDLE hevent = CreateEventW(NULL, FALSE, FALSE, NULL);
...@@ -862,7 +859,7 @@ static void wave_out_test_deviceOut(int device, double duration, ...@@ -862,7 +859,7 @@ static void wave_out_test_deviceOut(int device, double duration,
HeapFree(GetProcessHeap(), 0, buffer); HeapFree(GetProcessHeap(), 0, buffer);
EXIT: EXIT:
if ((flags & CALLBACK_TYPEMASK) == CALLBACK_THREAD) { if ((flags & CALLBACK_TYPEMASK) == CALLBACK_THREAD) {
PostThreadMessage(thread_id, WM_APP, 0, 0); PostThreadMessageW(thread_id, WM_APP, 0, 0);
WaitForSingleObject(hevent,10000); WaitForSingleObject(hevent,10000);
} }
CloseHandle(hevent); CloseHandle(hevent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment