Michael Stefaniuc : winmm/tests: Use the explicit CreateEventW() and don' t bother testing it.

Alexandre Julliard julliard at winehq.org
Mon Nov 4 13:59:19 CST 2013


Module: wine
Branch: master
Commit: a749f27ab311cfb4b84bf46bd33a889572bdd567
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a749f27ab311cfb4b84bf46bd33a889572bdd567

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Sun Nov  3 23:30:00 2013 +0100

winmm/tests: Use the explicit CreateEventW() and don't bother testing it.

---

 dlls/winmm/tests/capture.c |    7 +------
 dlls/winmm/tests/mixer.c   |    3 +--
 dlls/winmm/tests/wave.c    |    9 ++-------
 3 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/dlls/winmm/tests/capture.c b/dlls/winmm/tests/capture.c
index d3d60db..b4d7170 100644
--- a/dlls/winmm/tests/capture.c
+++ b/dlls/winmm/tests/capture.c
@@ -130,7 +130,7 @@ static void check_position(int device, HWAVEIN win, DWORD bytes,
 static void wave_in_test_deviceIn(int device, LPWAVEFORMATEX pwfx, DWORD format, DWORD flags, LPWAVEINCAPS pcaps)
 {
     HWAVEIN win;
-    HANDLE hevent;
+    HANDLE hevent = CreateEventW(NULL, FALSE, FALSE, NULL);
     WAVEHDR frag;
     MMRESULT rc;
     DWORD res;
@@ -139,11 +139,6 @@ static void wave_in_test_deviceIn(int device, LPWAVEFORMATEX pwfx, DWORD format,
     WORD wBitsPerSample = pwfx->wBitsPerSample;
     DWORD nSamplesPerSec = pwfx->nSamplesPerSec;
 
-    hevent=CreateEvent(NULL,FALSE,FALSE,NULL);
-    ok(hevent!=NULL,"CreateEvent(): error=%d\n",GetLastError());
-    if (hevent==NULL)
-        return;
-
     win=NULL;
     rc=waveInOpen(&win,device,pwfx,(DWORD_PTR)hevent,0,CALLBACK_EVENT|flags);
     /* Note: Win9x doesn't know WAVE_FORMAT_DIRECT */
diff --git a/dlls/winmm/tests/mixer.c b/dlls/winmm/tests/mixer.c
index 2f483db..c00f9fc 100644
--- a/dlls/winmm/tests/mixer.c
+++ b/dlls/winmm/tests/mixer.c
@@ -1069,8 +1069,7 @@ static void test_mixerOpen(void)
         if (rc == MMSYSERR_NOERROR)
             test_mixerClose(mix);
 
-        event = CreateEvent(NULL, FALSE, FALSE, NULL);
-        ok(event != NULL, "CreateEvent(): error=%d\n", GetLastError());
+        event = CreateEventW(NULL, FALSE, FALSE, NULL);
 
         /* NOTSUPPORTED is not broken, but it enables the todo_wine marker. */
         rc = mixerOpen(&mix, d, (DWORD_PTR)event, 0, CALLBACK_EVENT);
diff --git a/dlls/winmm/tests/wave.c b/dlls/winmm/tests/wave.c
index 8e33b69..4b061ed 100644
--- a/dlls/winmm/tests/wave.c
+++ b/dlls/winmm/tests/wave.c
@@ -598,7 +598,7 @@ static void wave_out_test_deviceOut(int device, double duration,
                                     BOOL interactive, BOOL sine, BOOL pause)
 {
     HWAVEOUT wout;
-    HANDLE hevent;
+    HANDLE hevent = CreateEventW(NULL, FALSE, FALSE, NULL);
     WAVEHDR *frags = 0;
     MMRESULT rc;
     DWORD volume;
@@ -616,11 +616,6 @@ static void wave_out_test_deviceOut(int device, double duration,
     DWORD frag_length;
     int i, j;
 
-    hevent=CreateEvent(NULL,FALSE,FALSE,NULL);
-    ok(hevent!=NULL,"CreateEvent(): error=%d\n",GetLastError());
-    if (hevent==NULL)
-        return;
-
     if ((flags & CALLBACK_TYPEMASK) == CALLBACK_EVENT) {
         callback = (DWORD_PTR)hevent;
         callback_instance = 0;
@@ -1532,7 +1527,7 @@ static void test_fragmentsize(void)
     fmt.nAvgBytesPerSec = fmt.nBlockAlign * fmt.nSamplesPerSec;
     fmt.cbSize = sizeof(WAVEFORMATEX);
 
-    hevent = CreateEvent(NULL, FALSE, FALSE, NULL);
+    hevent = CreateEventW(NULL, FALSE, FALSE, NULL);
     g_tid = GetCurrentThreadId();
 
     rc = waveOutOpen(&wout, WAVE_MAPPER, &fmt, (DWORD_PTR)callback_func,




More information about the wine-cvs mailing list