Author: akhaldi
Date: Sun Jun 4 01:49:55 2017
New Revision: 74874
URL:
http://svn.reactos.org/svn/reactos?rev=74874&view=rev
Log:
[WINMM_WINETEST] Sync with Wine Staging 2.9. CORE-13362
Modified:
trunk/rostests/winetests/winmm/CMakeLists.txt
trunk/rostests/winetests/winmm/joystick.c
trunk/rostests/winetests/winmm/mci.c
trunk/rostests/winetests/winmm/midi.c
trunk/rostests/winetests/winmm/wave.c
Modified: trunk/rostests/winetests/winmm/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winmm/CMakeList…
==============================================================================
--- trunk/rostests/winetests/winmm/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/winetests/winmm/CMakeLists.txt [iso-8859-1] Sun Jun 4 01:49:55 2017
@@ -14,7 +14,7 @@
add_executable(winmm_winetest ${SOURCE})
target_link_libraries(winmm_winetest dxguid)
set_module_type(winmm_winetest win32cui)
-add_importlibs(winmm_winetest winmm user32 advapi32 msvcrt kernel32)
+add_importlibs(winmm_winetest winmm user32 advapi32 ole32 msvcrt kernel32)
add_rostests_file(TARGET winmm_winetest)
if(NOT MSVC)
Modified: trunk/rostests/winetests/winmm/joystick.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winmm/joystick.…
==============================================================================
--- trunk/rostests/winetests/winmm/joystick.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/winmm/joystick.c [iso-8859-1] Sun Jun 4 01:49:55 2017
@@ -82,7 +82,9 @@
ret = joyGetDevCapsA(JOYSTICKID1 + i, &jc, sizeof(jc));
if (ret == JOYERR_NOERROR)
{
- joyid = JOYSTICKID1 + i;
+ if (joyid == -1) /* Cache the first found joystick to run advanced tests
below */
+ joyid = JOYSTICKID1 + i;
+
trace("Joystick[%d] - name: '%s', axes: %d, buttons: %d, period
range: %d - %d\n",
JOYSTICKID1 + i, jc.szPname, jc.wNumAxes, jc.wNumButtons,
jc.wPeriodMin, jc.wPeriodMax);
ret = joyGetDevCapsW(JOYSTICKID1 + i, &jcw, sizeof(jcw));
@@ -93,7 +95,6 @@
ok(jc.wNumButtons == jcw.wNumButtons, "Expected %d == %d\n",
jc.wNumButtons, jcw.wNumButtons);
}
else win98++;
- break;
}
else
{
Modified: trunk/rostests/winetests/winmm/mci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winmm/mci.c?rev…
==============================================================================
--- trunk/rostests/winetests/winmm/mci.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/winmm/mci.c [iso-8859-1] Sun Jun 4 01:49:55 2017
@@ -198,7 +198,7 @@
buf[0]='z';
err = mciSendStringA("", buf, sizeof(buf), NULL);
- todo_wine ok(err==MCIERR_MISSING_COMMAND_STRING,"empty string: %s\n",
dbg_mcierr(err));
+ ok(err==MCIERR_MISSING_COMMAND_STRING,"empty string: %s\n",
dbg_mcierr(err));
ok(!buf[0], "error buffer %s\n", buf);
buf[0]='d';
@@ -364,6 +364,10 @@
err = mciSendStringA("capability x device type", buf, sizeof(buf), hwnd);
ok(!err,"capability device type: %s\n", dbg_mcierr(err));
if(!err) ok(!strcmp(buf, "waveaudio"), "capability device type is
%s\n", buf);
+
+ err = mciSendStringA("info a version", buf, sizeof(buf), hwnd);
+ ok(!err,"info version: %s\n", dbg_mcierr(err));
+ if(!err) ok(!strcmp(buf, "1.1"), "info version is %s\n", buf);
err = mciSendCommandA(wDeviceID, MCI_CLOSE, 0, 0);
ok(!err,"mciCommand close returned %s\n", dbg_mcierr(err));
@@ -667,10 +671,6 @@
err = mciSendStringA("status x samplespersec", buf, sizeof(buf), NULL);
ok(!err,"mci status samplespersec returned %s\n", dbg_mcierr(err));
if(!err) ok(!strcmp(buf,"11025"), "mci status samplespersec expected
11025, got: %s\n", buf);
-
- /* MCI seems to solely support PCM, no need for ACM conversion. */
- err = mciSendStringA("set x format tag 2", NULL, 0, NULL);
- ok(err==MCIERR_OUTOFRANGE,"mci set format tag 2 returned %s\n",
dbg_mcierr(err));
/* MCI appears to scan the available devices for support of this format,
* returning MCIERR_OUTOFRANGE on machines with no sound.
@@ -1116,6 +1116,8 @@
trace("position after resume: %sms\n",buf);
test_notification(hwnd,"play (aborted by pause/resume/pause)",0);
+ /* A small Sleep() here prevents the notification test failing with
MCI_NOTIFY_SUCCESSFUL */
+ Sleep(10);
err = mciSendStringA("close mysound wait", NULL, 0, NULL);
ok(!err,"mci close wait returned %s\n", dbg_mcierr(err));
test_notification(hwnd,"play (aborted by close)",MCI_NOTIFY_ABORTED);
Modified: trunk/rostests/winetests/winmm/midi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winmm/midi.c?re…
==============================================================================
--- trunk/rostests/winetests/winmm/midi.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/winmm/midi.c [iso-8859-1] Sun Jun 4 01:49:55 2017
@@ -516,8 +516,8 @@
rc = midiOutPrepareHeader((HMIDIOUT)hm, &mhdr,
offsetof(MIDIHDR,dwOffset)-1);
ok(rc==MMSYSERR_INVALPARAM, "midiOutPrepare tiny rc=%s\n",
mmsys_error(rc));
- rc = midiOutPrepareHeader((HMIDIOUT)hm, &mhdr, offsetof(MIDIHDR,dwOffset));
- ok(!rc, "midiOutPrepare old size rc=%s\n", mmsys_error(rc));
+ rc = midiOutPrepareHeader((HMIDIOUT)hm, &mhdr, sizeof(mhdr));
+ ok(!rc, "midiOutPrepare size rc=%s\n", mmsys_error(rc));
ok(mhdr.dwFlags & MHDR_PREPARED, "MHDR.dwFlags when prepared %x\n",
mhdr.dwFlags);
/* The device is still in paused mode and should queue the message. */
@@ -559,9 +559,9 @@
/* Native fills dwOffset regardless of the cbMidiHdr size argument to
midiStreamOut */
ok(1234567890!=mhdr.dwOffset, "play left MIDIHDR.dwOffset at %u\n",
mhdr.dwOffset);
- rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr,
offsetof(MIDIHDR,dwOffset));
+ rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr, sizeof(mhdr));
ok(!rc, "midiOutUnprepare rc=%s\n", mmsys_error(rc));
- rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr,
offsetof(MIDIHDR,dwOffset));
+ rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr, sizeof(mhdr));
ok(!rc, "midiOutUnprepare #2 rc=%s\n", mmsys_error(rc));
trace("MIDIHDR stream flags=%x when finished\n", mhdr.dwFlags);
@@ -586,9 +586,9 @@
mhdr.dwFlags |= MHDR_ISSTRM;
/* Preset flags (e.g. MHDR_ISSTRM) do not disturb. */
- rc = midiOutPrepareHeader((HMIDIOUT)hm, &mhdr, offsetof(MIDIHDR,dwOffset));
+ rc = midiOutPrepareHeader((HMIDIOUT)hm, &mhdr, sizeof(mhdr));
ok(!rc, "midiOutPrepare used flags %x rc=%s\n", mhdr.dwFlags,
mmsys_error(rc));
- rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr,
offsetof(MIDIHDR,dwOffset));
+ rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr, sizeof(mhdr));
ok(!rc, "midiOutUnprepare used flags %x rc=%s\n", mhdr.dwFlags,
mmsys_error(rc));
rc = midiStreamRestart(hm);
@@ -837,10 +837,15 @@
START_TEST(midi)
{
HWND hwnd = 0;
+
+ CoInitialize(NULL); /* Needed for Win 10 */
+
if (1) /* select 1 for CALLBACK_WINDOW or 0 for CALLBACK_FUNCTION */
hwnd = CreateWindowExA(0, "static", "winmm midi test", WS_POPUP,
0,0,100,100,
0, 0, 0, NULL);
test_midi_infns(hwnd);
test_midi_outfns(hwnd);
if (hwnd) DestroyWindow(hwnd);
-}
+
+ CoUninitialize();
+}
Modified: trunk/rostests/winetests/winmm/wave.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winmm/wave.c?re…
==============================================================================
--- trunk/rostests/winetests/winmm/wave.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/winmm/wave.c [iso-8859-1] Sun Jun 4 01:49:55 2017
@@ -1600,6 +1600,7 @@
rc = waveOutClose(wout);
ok(rc == MMSYSERR_NOERROR, "waveOutClose failed: %s\n",
wave_out_error(rc));
+ HeapFree(GetProcessHeap(), 0, hdr[0].lpData);
CloseHandle(hevent);
}
@@ -1659,6 +1660,12 @@
{
BOOL br;
char test_file[MAX_PATH], temp[MAX_PATH], *exts;
+ void *psound_ordinal, *psound_name;
+ HMODULE dll = GetModuleHandleA("winmm.dll");
+
+ psound_name = GetProcAddress(dll, "PlaySound");
+ psound_ordinal = GetProcAddress(dll, (LPCSTR) 2);
+ ok(psound_name == psound_ordinal, "Expected ordinal 2 to be PlaySound
function\n");
if(waveOutGetNumDevs() == 0) {
skip("No output devices available\n");