2006-09-06 10:43:24 +02:00
|
|
|
/*
|
|
|
|
* Test winmm mci
|
|
|
|
*
|
|
|
|
* Copyright 2006 Jan Zerebecki
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "wine/test.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "mmsystem.h"
|
|
|
|
|
|
|
|
START_TEST(mci)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
const char command_open[] = "open new type waveaudio alias mysound";
|
|
|
|
const char command_close_my[] = "close mysound notify";
|
|
|
|
const char command_close_all[] = "close all notify";
|
2008-07-19 03:56:45 +02:00
|
|
|
const char command_sysinfo[] = "sysinfo waveaudio quantity open";
|
2006-09-06 10:43:24 +02:00
|
|
|
MSG msg;
|
2008-07-19 03:56:45 +02:00
|
|
|
char buf[1024];
|
2006-09-06 10:43:24 +02:00
|
|
|
|
|
|
|
err = mciSendString(command_open, NULL, 0, NULL);
|
|
|
|
ok(!err,"mciSendString(%s, NULL, 0 , NULL) returned error: %d\n", command_open, err);
|
|
|
|
|
|
|
|
err = mciSendString(command_close_my, NULL, 0, NULL);
|
|
|
|
ok(!err,"mciSendString(%s, NULL, 0 , NULL) returned error: %d\n", command_close_my, err);
|
|
|
|
|
|
|
|
ok(PeekMessageW( &msg, (HWND)-1, 0, 0, PM_REMOVE ), "PeekMessage should succeed\n");
|
|
|
|
ok(msg.hwnd == NULL, "got %p instead of NULL\n", msg.hwnd);
|
|
|
|
ok(msg.message == MM_MCINOTIFY, "got %04x instead of MM_MCINOTIFY\n", msg.message);
|
2007-05-24 16:41:17 +02:00
|
|
|
ok(msg.wParam == MCI_NOTIFY_SUCCESSFUL, "got %08lx instead of MCI_NOTIFY_SUCCESSFUL\n", msg.wParam);
|
2006-09-06 10:43:24 +02:00
|
|
|
|
|
|
|
err = mciSendString(command_close_all, NULL, 0, NULL);
|
|
|
|
todo_wine ok(!err,"mciSendString(%s, NULL, 0 , NULL) returned error: %d\n", command_close_all, err);
|
|
|
|
|
2008-07-19 03:56:45 +02:00
|
|
|
memset(buf, 0, sizeof(buf));
|
|
|
|
err = mciSendString(command_close_all, buf, sizeof(buf), NULL);
|
|
|
|
todo_wine ok(!err,"mciSendString(%s, buf, sizeof(buf) , NULL) returned error: %d\n", command_close_all, err);
|
|
|
|
todo_wine ok(buf[0] == 0, "mciSendString(%s, buf, sizeof(buf) , NULL) changed output buffer: %s\n", command_close_all, buf);
|
|
|
|
|
|
|
|
memset(buf, 0, sizeof(buf));
|
|
|
|
err = mciSendString(command_sysinfo, buf, sizeof(buf), NULL);
|
|
|
|
ok(!err,"mciSendString(%s, buf, sizeof(buf) , NULL) returned error: %d\n", command_sysinfo, err);
|
|
|
|
todo_wine ok(buf[0] == '0' && buf[1] == 0, "mciSendString(%s, buf, sizeof(buf) , NULL), expected output buffer '0', got: '%s'\n", command_sysinfo, buf);
|
|
|
|
|
2006-09-06 10:43:24 +02:00
|
|
|
err = mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_NOTIFY, 0);
|
|
|
|
todo_wine ok(err == MCIERR_INVALID_DEVICE_ID,
|
|
|
|
"mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_NOTIFY, NULL) returned %d instead of %d\n",
|
|
|
|
err, MCIERR_INVALID_DEVICE_ID);
|
|
|
|
}
|