Jörg Höhle : winmm/tests: Add a few Open/ Close MCI tests.
Alexandre Julliard
julliard at winehq.org
Thu Sep 2 12:01:27 CDT 2010
Module: wine
Branch: master
Commit: 0cf326ce55a4e92773d4534555806a9844d190cb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0cf326ce55a4e92773d4534555806a9844d190cb
Author: Jörg Höhle <hoehle at users.sourceforge.net>
Date: Tue Jul 6 18:09:27 2010 +0200
winmm/tests: Add a few Open/Close MCI tests.
---
dlls/winmm/tests/mci.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c
index 19082e8..236a722 100644
--- a/dlls/winmm/tests/mci.c
+++ b/dlls/winmm/tests/mci.c
@@ -259,6 +259,12 @@ static void test_openCloseWAVE(HWND hwnd)
ok(err==MCIERR_PARAM_OVERFLOW || broken(!err /* Win9x */),"mciCommand MCI_SYSINFO all name 1 open too small: %s\n", dbg_mcierr(err));
if(!err) ok(!strcmp(buf,"mysound"), "sysinfo short name returned %s\n", buf);
+ err = mciSendString("sysinfo mysound quantity open", buf, sizeof(buf), hwnd);
+ todo_wine ok(err==MCIERR_DEVICE_TYPE_REQUIRED,"sysinfo alias quantity returned %s\n", dbg_mcierr(err));
+
+ err = mciSendString("sysinfo nosuchalias quantity open", buf, sizeof(buf), hwnd);
+ todo_wine ok(err==MCIERR_DEVICE_TYPE_REQUIRED,"sysinfo unknown quantity open returned %s\n", dbg_mcierr(err));
+
err = mciGetDeviceID("all");
ok(MCI_ALL_DEVICE_ID==err || /* Win9x */(UINT16)MCI_ALL_DEVICE_ID==err,"mciGetDeviceID all returned %u, expected %d\n", err, MCI_ALL_DEVICE_ID);
@@ -282,6 +288,21 @@ static void test_openCloseWAVE(HWND hwnd)
ok(!err,"close y returned %s\n", dbg_mcierr(err));
}
+ err = mciSendString("open ! alias no", buf, sizeof(buf), NULL);
+ ok(err==MCIERR_INVALID_DEVICE_NAME,"open !(void): %s\n", dbg_mcierr(err));
+
+ err = mciSendString("open !no-such-file-exists.wav alias no", buf, sizeof(buf), NULL);
+ ok(err==MCIERR_FILE_NOT_FOUND || /* Win9X */err==MCIERR_INVALID_DEVICE_NAME,"open !name: %s\n", dbg_mcierr(err));
+
+ /* FILE_NOT_FOUND stems from mciwave,
+ * the complete name including ! is passed through since NT */
+ err = mciSendString("open nosuchdevice!tempfile.wav alias no", buf, sizeof(buf), NULL);
+ ok(err==MCIERR_FILE_NOT_FOUND || /* Win9X */err==MCIERR_INVALID_DEVICE_NAME,"open nosuchdevice!name: %s\n", dbg_mcierr(err));
+ /* FIXME? use broken(INVALID_DEVICE_NAME) and have Wine not mimic Win9X? */
+
+ err = mciSendString("close waveaudio", buf, sizeof(buf), NULL);
+ todo_wine ok(err==MCIERR_INVALID_DEVICE_NAME,"open nosuchdevice!name: %s\n", dbg_mcierr(err));
+
err = mciSendString(command_close_all, NULL, 0, NULL);
ok(!err,"mci %s (without buffer) returned %s\n", command_close_all, dbg_mcierr(err));
@@ -317,6 +338,9 @@ static void test_openCloseWAVE(HWND hwnd)
ok(0xDEADF00D==intbuf[0] && 0xABADCAFE==intbuf[2],"DWORD buffer corruption\n");
+ err = mciGetDeviceID("waveaudio");
+ ok(err==1,"mciGetDeviceID waveaudio returned %u, expected 0\n", err);
+
err = mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_WAIT, 0); /* from MSDN */
ok(!err,"mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_WAIT, 0) returned %s\n", dbg_mcierr(err));
More information about the wine-cvs
mailing list