[DINPUT] bug fixes with tests

Robert Reif reif at earthlink.net
Fri Apr 22 07:59:31 CDT 2005


Change log:
- Fix data format bug.
- Fix error results.
- Add joystick tests.

The joystick test has an interactive mode where you can exercise
the joystick and view the results for 30 seconds for each joystick.

In order to test your joysticks properly, make sure you have
a mapping entry in the registry for your joystick.

I have these two entries in my registry in HKLM\Software\Wine\dinput:

value name: Microsoft SideWinder Precision 2 Joystick
value data: X,Y,Rx,Slider1,POV1

and

value name: Logitech Logitech Extreme 3D Pro
value data: X,Y,Rx,Slider1,POV1



-------------- next part --------------
diff -u wine.cvs/configure.ac wine/configure.ac
--- wine.cvs/configure.ac	2005-04-22 08:30:29.000000000 -0400
+++ wine/configure.ac	2005-04-20 19:02:32.000000000 -0400
@@ -1542,6 +1542,7 @@
 dlls/ddraw/tests/Makefile
 dlls/devenum/Makefile
 dlls/dinput/Makefile
+dlls/dinput/tests/Makefile
 dlls/dinput8/Makefile
 dlls/dmband/Makefile
 dlls/dmcompos/Makefile
diff -u wine.cvs/dlls/dinput/device.c wine/dlls/dinput/device.c
--- wine.cvs/dlls/dinput/device.c	2005-04-22 08:30:32.000000000 -0400
+++ wine/dlls/dinput/device.c	2005-04-15 21:24:49.000000000 -0400
@@ -289,34 +289,35 @@
     int *done;
     int index = 0;
     DWORD next = 0;
-    
+
     ret = HeapAlloc(GetProcessHeap(), 0, sizeof(DataFormat));
-    
+
     done = HeapAlloc(GetProcessHeap(), 0, sizeof(int) * asked_format->dwNumObjs);
     memset(done, 0, sizeof(int) * asked_format->dwNumObjs);
-    
+
     dt = HeapAlloc(GetProcessHeap(), 0, asked_format->dwNumObjs * sizeof(DataTransform));
-    
+
     TRACE("Creating DataTransform : \n");
     
     for (i = 0; i < wine_format->dwNumObjs; i++) {
 	offset[i] = -1;
-	
+
 	for (j = 0; j < asked_format->dwNumObjs; j++) {
 	    if (done[j] == 1)
 		continue;
-	    
+
 	    if (/* Check if the application either requests any GUID and if not, it if matches
 		 * the GUID of the Wine object.
 		 */
 		((asked_format->rgodf[j].pguid == NULL) ||
+		 (wine_format->rgodf[i].pguid == NULL) ||
 		 (IsEqualGUID(wine_format->rgodf[i].pguid, asked_format->rgodf[j].pguid)))
 		&&
 		(/* Then check if it accepts any instance id, and if not, if it matches Wine's
 		  * instance id.
 		  */
 		 ((asked_format->rgodf[j].dwType & 0x00FFFF00) == DIDFT_ANYINSTANCE) ||
-		 (wine_format->rgodf[i].dwType & asked_format->rgodf[j].dwType))) {
+		 ((wine_format->rgodf[i].dwType & asked_format->rgodf[j].dwType)) & 0x00FFFF00)) {
 		
 		done[j] = 1;
 		
@@ -329,19 +330,19 @@
 		TRACE("       * dwType: %08lx\n", asked_format->rgodf[j].dwType);
 		TRACE("         "); _dump_EnumObjects_flags(asked_format->rgodf[j].dwType); TRACE("\n");
 		
-		TRACE("   - Wine  (%d) :\n", j);
+		TRACE("   - Wine  (%d) :\n", i);
 		TRACE("       * GUID: %s ('%s')\n",
-		      debugstr_guid(wine_format->rgodf[j].pguid),
-		      _dump_dinput_GUID(wine_format->rgodf[j].pguid));
-		TRACE("       * Offset: %3ld\n", wine_format->rgodf[j].dwOfs);
-		TRACE("       * dwType: %08lx\n", wine_format->rgodf[j].dwType);
-		TRACE("         "); _dump_EnumObjects_flags(wine_format->rgodf[j].dwType); TRACE("\n");
+		      debugstr_guid(wine_format->rgodf[i].pguid),
+		      _dump_dinput_GUID(wine_format->rgodf[i].pguid));
+		TRACE("       * Offset: %3ld\n", wine_format->rgodf[i].dwOfs);
+		TRACE("       * dwType: %08lx\n", wine_format->rgodf[i].dwType);
+		TRACE("         "); _dump_EnumObjects_flags(wine_format->rgodf[i].dwType); TRACE("\n");
 		
 		if (wine_format->rgodf[i].dwType & DIDFT_BUTTON)
 		    dt[index].size = sizeof(BYTE);
 		else
 		    dt[index].size = sizeof(DWORD);
-		dt[index].offset_in  = wine_format ->rgodf[i].dwOfs;
+		dt[index].offset_in  = wine_format->rgodf[i].dwOfs;
                 if (asked_format->rgodf[j].dwOfs < next) {
                     WARN("bad format: dwOfs=%ld, changing to %ld\n", asked_format->rgodf[j].dwOfs, next);
 		    dt[index].offset_out = next;
diff -u wine.cvs/dlls/dinput/dinput_main.c wine/dlls/dinput/dinput_main.c
--- wine.cvs/dlls/dinput/dinput_main.c	2005-04-22 08:30:32.000000000 -0400
+++ wine/dlls/dinput/dinput_main.c	2005-04-17 16:39:42.000000000 -0400
@@ -331,6 +331,16 @@
 
 	TRACE("(this=%p,%s,%p,%p)\n",This,debugstr_guid(rguid),pdev,punk);
 
+	if (pdev == NULL) {
+		WARN("invalid pointer: pdev == NULL\n");
+		return E_POINTER;
+	}
+
+	if (rguid == NULL) {
+		WARN("invalid pointer: rguid == NULL\n");
+		return E_POINTER;
+	}
+
 	/* Loop on all the devices to see if anyone matches the given GUID */
 	for (i = 0; i < NB_DINPUT_DEVICES; i++) {
 	  HRESULT ret;
diff -u wine.cvs/dlls/dinput/joystick_linux.c wine/dlls/dinput/joystick_linux.c
--- wine.cvs/dlls/dinput/joystick_linux.c	2005-04-22 08:30:32.000000000 -0400
+++ wine/dlls/dinput/joystick_linux.c	2005-04-21 19:47:19.000000000 -0400
@@ -713,6 +713,16 @@
 
     TRACE("(%p,%p)\n",This,df);
 
+    if (df == NULL) {
+        WARN("invalid pointer\n");
+        return E_POINTER;
+    }
+
+    if (df->dwSize != sizeof(*df)) {
+        WARN("invalid argument\n");
+        return DIERR_INVALIDPARAM;
+    }
+
     if (This->acquired) {
         WARN("acquired\n");
         return DIERR_ACQUIRED;
@@ -1113,6 +1123,11 @@
 
     TRACE("(%p,%s,%p)\n",This,debugstr_guid(rguid),ph);
 
+    if (ph == NULL) {
+        WARN("invalid pointer\n");
+        return E_POINTER;
+    }
+
     if (TRACE_ON(dinput))
         _dump_DIPROPHEADER(ph);
 
@@ -1214,10 +1229,16 @@
 
     if (lpDIDevCaps == NULL) {
         WARN("invalid parameter: lpDIDevCaps = NULL\n");
-        return DIERR_INVALIDPARAM;
+        return E_POINTER;
     }
 
     size = lpDIDevCaps->dwSize;
+
+    if (!(size == sizeof(DIDEVCAPS) || size == sizeof(DIDEVCAPS_DX3))) {
+        WARN("invalid parameter\n");
+        return DIERR_INVALIDPARAM;
+    }
+
     CopyMemory(lpDIDevCaps, &This->devcaps, size);
     lpDIDevCaps->dwSize = size;
 
diff -u wine.cvs/dlls/dinput/Makefile.in wine/dlls/dinput/Makefile.in
--- wine.cvs/dlls/dinput/Makefile.in	2004-09-14 21:15:48.000000000 -0400
+++ wine/dlls/dinput/Makefile.in	2005-04-22 08:42:24.000000000 -0400
@@ -18,6 +18,8 @@
 
 RC_SRCS = version.rc
 
+SUBDIRS = tests
+
 @MAKE_DLL_RULES@
 
 ### Dependencies:
diff -u -N wine.cvs/dlls/dinput/tests/.cvsignore wine/dlls/dinput/tests/.cvsignore
--- wine.cvs/dlls/dinput/tests/.cvsignore	1969-12-31 19:00:00.000000000 -0500
+++ wine/dlls/dinput/tests/.cvsignore	2005-04-16 18:10:08.000000000 -0400
@@ -0,0 +1,3 @@
+Makefile
+dinput.ok
+testlist.c
diff -u -N wine.cvs/dlls/dinput/tests/dinput.c wine/dlls/dinput/tests/dinput.c
--- wine.cvs/dlls/dinput/tests/dinput.c	1969-12-31 19:00:00.000000000 -0500
+++ wine/dlls/dinput/tests/dinput.c	2005-04-22 08:21:41.000000000 -0400
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c) 2004-2005 Robert Reif
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#define STRICT
+#define DIRECTINPUT_VERSION 0x0700
+
+#define NONAMELESSSTRUCT
+#define NONAMELESSUNION
+#include <windows.h>
+
+#include <math.h>
+#include <stdlib.h>
+
+#include "wine/test.h"
+#include "windef.h"
+#include "wingdi.h"
+#include "dinput.h"
+#include "dxerr8.h"
+
+/* FIXME: in windows, you would link dinput.lib to get c_dfDIJoystick2 */
+#include "../data_formats.c"
+
+#define numObjects(x) (sizeof(x) / sizeof(x[0]))
+
+static const DIOBJECTDATAFORMAT dfDIJoystickTest[] = {
+  { &GUID_XAxis,DIJOFS_X,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
+  { &GUID_YAxis,DIJOFS_Y,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
+  { &GUID_ZAxis,DIJOFS_Z,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
+  { &GUID_RxAxis,DIJOFS_RX,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
+  { &GUID_RyAxis,DIJOFS_RY,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
+  { &GUID_RzAxis,DIJOFS_RZ,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
+  { &GUID_Button,DIJOFS_BUTTON(0),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
+  { &GUID_Button,DIJOFS_BUTTON(1),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
+  { &GUID_Button,DIJOFS_BUTTON(2),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
+  { &GUID_Button,DIJOFS_BUTTON(3),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
+  { &GUID_Button,DIJOFS_BUTTON(4),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
+  { &GUID_Button,DIJOFS_BUTTON(5),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
+  { &GUID_Button,DIJOFS_BUTTON(6),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
+  { &GUID_Button,DIJOFS_BUTTON(7),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
+  { &GUID_Button,DIJOFS_BUTTON(8),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
+  { &GUID_Button,DIJOFS_BUTTON(9),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
+  { &GUID_Button,DIJOFS_BUTTON(10),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
+};
+
+static const DIDATAFORMAT c_dfDIJoystickTest = {
+    sizeof(DIDATAFORMAT),
+    sizeof(DIOBJECTDATAFORMAT),
+    DIDF_ABSAXIS,
+    sizeof(DIJOYSTATE2),
+    numObjects(dfDIJoystickTest),
+    (LPDIOBJECTDATAFORMAT)dfDIJoystickTest
+};
+
+HWND get_hwnd()
+{
+    HWND hwnd=GetForegroundWindow();
+    if (!hwnd)
+        hwnd=GetDesktopWindow();
+    return hwnd;
+}
+
+typedef struct tagJoystickInfo
+{
+    LPDIRECTINPUTDEVICE pJoystick;
+    int axis;
+    int pov;
+    int button;
+} JoystickInfo;
+
+static BOOL CALLBACK EnumAxes(
+    const DIDEVICEOBJECTINSTANCE* pdidoi,
+    VOID* pContext)
+{
+    HRESULT hr;
+    JoystickInfo * info = (JoystickInfo *)pContext;
+
+    if (IsEqualIID(&pdidoi->guidType, &GUID_XAxis) ||
+        IsEqualIID(&pdidoi->guidType, &GUID_YAxis) ||
+        IsEqualIID(&pdidoi->guidType, &GUID_ZAxis) ||
+        IsEqualIID(&pdidoi->guidType, &GUID_RxAxis) ||
+        IsEqualIID(&pdidoi->guidType, &GUID_RyAxis) ||
+        IsEqualIID(&pdidoi->guidType, &GUID_RzAxis) ||
+        IsEqualIID(&pdidoi->guidType, &GUID_Slider)) {
+        DIPROPRANGE diprg;
+        diprg.diph.dwSize       = sizeof(DIPROPRANGE);
+        diprg.diph.dwHeaderSize = sizeof(DIPROPHEADER);
+        diprg.diph.dwHow        = DIPH_BYID;
+        diprg.diph.dwObj        = pdidoi->dwType;
+        diprg.lMin              = -1000;
+        diprg.lMax              = +1000;
+
+        hr = IDirectInputDevice_SetProperty(info->pJoystick, DIPROP_RANGE, NULL);
+        ok(hr==E_POINTER,"IDirectInputDevice_SetProperty() should have returned "
+           "E_POINTER, returned: %s\n", DXGetErrorString8(hr));
+
+        hr = IDirectInputDevice_SetProperty(info->pJoystick, DIPROP_RANGE, &diprg.diph);
+        ok(hr==DI_OK,"IDirectInputDevice_SetProperty() failed: %s\n", DXGetErrorString8(hr));
+
+        info->axis++;
+    } else if (IsEqualIID(&pdidoi->guidType, &GUID_POV))
+        info->pov++;
+    else if (IsEqualIID(&pdidoi->guidType, &GUID_Button))
+        info->button++;
+
+    return DIENUM_CONTINUE;
+}
+
+static BOOL CALLBACK EnumJoysticks(
+    LPCDIDEVICEINSTANCE lpddi,
+    LPVOID pvRef)
+{
+    HRESULT hr;
+    LPDIRECTINPUT pDI = (LPDIRECTINPUT)pvRef;
+    LPDIRECTINPUTDEVICE pJoystick;
+    DIDATAFORMAT format;
+    DIDEVCAPS caps;
+    DIJOYSTATE2 js;
+    JoystickInfo info;
+    int i, count;
+    ULONG ref;
+
+    hr = IDirectInput_CreateDevice(pDI, &lpddi->guidInstance, NULL, NULL);
+    ok(hr==E_POINTER,"IDirectInput_CreateDevice() should have returned "
+       "E_POINTER, returned: %s\n", DXGetErrorString8(hr));
+
+    hr = IDirectInput_CreateDevice(pDI, NULL, &pJoystick, NULL);
+    ok(hr==E_POINTER,"IDirectInput_CreateDevice() should have returned "
+       "E_POINTER, returned: %s\n", DXGetErrorString8(hr));
+
+    hr = IDirectInput_CreateDevice(pDI, NULL, NULL, NULL);
+    ok(hr==E_POINTER,"IDirectInput_CreateDevice() should have returned "
+       "E_POINTER, returned: %s\n", DXGetErrorString8(hr));
+
+    hr = IDirectInput_CreateDevice(pDI, &lpddi->guidInstance, &pJoystick, NULL);
+    ok(hr==DI_OK,"IDirectInput_CreateDevice() failed: %s\n",
+       DXGetErrorString8(hr));
+    if (hr!=DI_OK)
+        goto DONE;
+
+    trace("---- %s ----\n", lpddi->tszProductName);
+
+    hr = IDirectInputDevice_SetDataFormat(pJoystick, NULL);
+    ok(hr==E_POINTER,"IDirectInputDevice_SetDataFormat() should have returned "
+       "E_POINTER, returned: %s\n", DXGetErrorString8(hr));
+
+    ZeroMemory(&format, sizeof(format));
+    hr = IDirectInputDevice_SetDataFormat(pJoystick, &format);
+    ok(hr==DIERR_INVALIDPARAM,"IDirectInputDevice_SetDataFormat() should have "
+       "returned DIERR_INVALIDPARAM, returned: %s\n", DXGetErrorString8(hr));
+
+    /* try the default formats */
+    hr = IDirectInputDevice_SetDataFormat(pJoystick, &c_dfDIJoystick);
+    ok(hr==DI_OK,"IDirectInputDevice_SetDataFormat() failed: %s\n",
+       DXGetErrorString8(hr));
+
+    hr = IDirectInputDevice_SetDataFormat(pJoystick, &c_dfDIJoystick2);
+    ok(hr==DI_OK,"IDirectInputDevice_SetDataFormat() failed: %s\n",
+       DXGetErrorString8(hr));
+
+    /* try an alternate format */
+    hr = IDirectInputDevice_SetDataFormat(pJoystick, &c_dfDIJoystickTest);
+    ok(hr==DI_OK,"IDirectInputDevice_SetDataFormat() failed: %s\n",
+       DXGetErrorString8(hr));
+
+    hr = IDirectInputDevice_SetDataFormat(pJoystick, &c_dfDIJoystick2);
+    ok(hr==DI_OK,"IDirectInputDevice_SetDataFormat() failed: %s\n",
+       DXGetErrorString8(hr));
+    if (hr != DI_OK)
+        goto RELEASE;
+
+    hr = IDirectInputDevice_SetCooperativeLevel(pJoystick, get_hwnd(),
+                                                DISCL_EXCLUSIVE | DISCL_FOREGROUND);
+    ok(hr==DI_OK,"IDirectInputDevice_SetCooperativeLevel() failed: %s\n",
+       DXGetErrorString8(hr));
+
+    /* get capabilities */
+    hr = IDirectInputDevice_GetCapabilities(pJoystick, NULL);
+    ok(hr==E_POINTER,"IDirectInputDevice_GetCapabilities() "
+       "should have returned E_POINTER, returned: %s\n",
+       DXGetErrorString8(hr));
+
+    ZeroMemory(&caps, sizeof(caps));
+    hr = IDirectInputDevice_GetCapabilities(pJoystick, &caps);
+    ok(hr==DIERR_INVALIDPARAM,"IDirectInputDevice_GetCapabilities() "
+       "should have returned DIERR_INVALIDPARAM, returned: %s\n",
+       DXGetErrorString8(hr));
+
+    caps.dwSize = sizeof(caps);
+    hr = IDirectInputDevice_GetCapabilities(pJoystick, &caps);
+    ok(hr==DI_OK,"IDirectInputDevice_GetCapabilities() failed: %s\n",
+       DXGetErrorString8(hr));
+
+    ZeroMemory(&info, sizeof(info));
+    info.pJoystick = pJoystick;
+
+    /* enumerate objects */
+    hr = IDirectInputDevice_EnumObjects(pJoystick,  EnumAxes, (VOID*)&info, DIDFT_ALL);
+    ok(hr==DI_OK,"IDirectInputDevice_EnumObjects() failed: %s\n",
+       DXGetErrorString8(hr));
+
+    ok(caps.dwAxes == info.axis, "Number of enumerated axes doesn't match capabilities\n");
+    ok(caps.dwButtons == info.button, "Number of enumerated buttons doesn't match capabilities\n");
+    ok(caps.dwPOVs == info.pov, "Number of enumerated buttons doesn't match capabilities\n");
+
+    hr = IDirectInputDevice_Acquire(pJoystick);
+    ok(hr==DI_OK,"IDirectInputDevice_Acquire() failed: %s\n",
+       DXGetErrorString8(hr));
+    if (hr != DI_OK)
+        goto RELEASE;
+
+    if (winetest_interactive) {
+        trace("You have 30 seconds to test all axes, sliders, POVs and buttons\n");
+        count = 300;
+    } else
+        count = 1;
+
+    trace("\n");
+    for (i = 0; i < count; i++) {
+        hr = IDirectInputDevice_GetDeviceState(pJoystick, sizeof(DIJOYSTATE2), &js);
+        ok(hr==DI_OK,"IDirectInputDevice_GetDeviceState() failed: %s\n",
+           DXGetErrorString8(hr));
+        if (hr != DI_OK)
+            break;
+        trace("X%5ld Y%5ld Z%5ld Rx%5ld Ry%5ld Rz%5ld "
+              "S0%5ld S1%5ld POV0%5ld POV1%5ld POV2%5ld POV3%5ld "
+              "B %d %d %d %d %d %d %d %d %d %d %d %d\r",
+              js.lX, js.lY, js.lZ, js.lRx, js.lRy, js.lRz,
+              js.rglSlider[0], js.rglSlider[1],
+              js.rgdwPOV[0], js.rgdwPOV[1], js.rgdwPOV[2], js.rgdwPOV[3],
+              js.rgbButtons[0]>>7, js.rgbButtons[1]>>7, js.rgbButtons[2]>>7,
+              js.rgbButtons[3]>>7, js.rgbButtons[4]>>7, js.rgbButtons[5]>>7,
+              js.rgbButtons[6]>>7, js.rgbButtons[7]>>7, js.rgbButtons[8]>>7,
+              js.rgbButtons[9]>>7, js.rgbButtons[10]>>7, js.rgbButtons[11]>>7);
+        Sleep(100);
+    }
+    trace("\n");
+
+    hr = IDirectInputDevice_Unacquire(pJoystick);
+    ok(hr==DI_OK,"IDirectInputDevice_Unacquire() failed: %s\n",
+       DXGetErrorString8(hr));
+
+RELEASE:
+    ref = IDirectInputDevice_Release(pJoystick);
+    ok(ref==0,"IDirectInputDevice_Release() reference count = %ld\n", ref);
+
+DONE:
+    return DIENUM_CONTINUE;
+}
+
+static void dinput_joystick_tests()
+{
+    HRESULT hr;
+    LPDIRECTINPUT pDI;
+    ULONG ref;
+
+    hr = DirectInputCreate(GetModuleHandle(NULL), DIRECTINPUT_VERSION, &pDI, NULL);
+    ok(hr==DI_OK, "DirectInputCreate() failed: %s\n", DXGetErrorString8(hr));
+    if (hr!=DI_OK)
+        return;
+
+    hr = IDirectInput_EnumDevices(pDI, DIDEVTYPE_JOYSTICK, EnumJoysticks, pDI, DIEDFL_ALLDEVICES);
+    ok(hr==DI_OK,"IDirectInput_EnumDevices() failed: %s\n", DXGetErrorString8(hr));
+
+    ref = IDirectInput_Release(pDI);
+    ok(ref==0,"IDirectInput_Release() reference count = %ld\n", ref);
+}
+
+START_TEST(dinput)
+{
+    dinput_joystick_tests();
+}
diff -u -N wine.cvs/dlls/dinput/tests/Makefile.in wine/dlls/dinput/tests/Makefile.in
--- wine.cvs/dlls/dinput/tests/Makefile.in	1969-12-31 19:00:00.000000000 -0500
+++ wine/dlls/dinput/tests/Makefile.in	2005-04-16 18:10:08.000000000 -0400
@@ -0,0 +1,14 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+TESTDLL   = dinput.dll
+IMPORTS   = dinput ole32 user32 kernel32
+EXTRALIBS = -ldxguid -luuid -ldxerr8
+
+CTESTS = \
+	dinput.c
+
+ at MAKE_TEST_RULES@
+
+### Dependencies:


More information about the wine-patches mailing list