PATCH: ddraw conformance tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ChangeLog:
Added some conformance tests for ddraw. These enumerate some display modes
and then attempt to open them.
 
? dlls/Make.rules
? dlls/config.log
? dlls/config.status
? dlls/controls
? dlls/dlls
? dlls/documentation
? dlls/files
? dlls/graphics
? dlls/include
? dlls/libs
? dlls/loader
? dlls/memory
? dlls/misc
? dlls/miscemu
? dlls/msdos
? dlls/objects
? dlls/programs
? dlls/scheduler
? dlls/server
? dlls/tools
? dlls/windows
? dlls/ddraw/tests
? dlls/user/tests/testlist.ok
? miscemu/Makefile
? miscemu/wine
Index: configure
===================================================================
RCS file: /home/wine/wine/configure,v
retrieving revision 1.476
diff -u -r1.476 configure
--- configure	6 Nov 2003 23:05:41 -0000	1.476
+++ configure	8 Nov 2003 00:29:53 -0000
@@ -16914,7 +16914,7 @@
 MAKE_PROG_RULES=programs/Makeprog.rules
 
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrtd/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/uxtheme/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/uuid/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrtd/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/uxtheme/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/uuid/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -17471,6 +17471,7 @@
   "dlls/d3dx8/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/d3dx8/Makefile" ;;
   "dlls/dciman32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dciman32/Makefile" ;;
   "dlls/ddraw/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/ddraw/Makefile" ;;
+  "dlls/ddraw/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/ddraw/tests/Makefile" ;;
   "dlls/devenum/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/devenum/Makefile" ;;
   "dlls/dinput/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dinput/Makefile" ;;
   "dlls/dinput8/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dinput8/Makefile" ;;
Index: configure.ac
===================================================================
RCS file: /home/wine/wine/configure.ac,v
retrieving revision 1.197
diff -u -r1.197 configure.ac
--- configure.ac	6 Nov 2003 23:05:41 -0000	1.197
+++ configure.ac	8 Nov 2003 00:29:56 -0000
@@ -1439,6 +1439,7 @@
 dlls/d3dx8/Makefile
 dlls/dciman32/Makefile
 dlls/ddraw/Makefile
+dlls/ddraw/tests/Makefile
 dlls/devenum/Makefile
 dlls/dinput/Makefile
 dlls/dinput8/Makefile
Index: dlls/ddraw/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/Makefile.in,v
retrieving revision 1.31
diff -u -r1.31 Makefile.in
--- dlls/ddraw/Makefile.in	11 Oct 2003 01:09:20 -0000	1.31
+++ dlls/ddraw/Makefile.in	8 Nov 2003 00:29:56 -0000
@@ -46,6 +46,8 @@
 
 RC_SRCS = version.rc
 
+SUBDIRS = tests
+
 EXTRASUBDIRS = \
 	d3ddevice \
 	dclipper \
--- /dev/null	Sun Mar  9 04:57:43 2003
+++ dlls/ddraw/tests/Makefile.in	Sat Nov  8 13:09:20 2003
@@ -0,0 +1,14 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+TESTDLL   = ddraw.dll
+IMPORTS   = ddraw user32 gdi32 kernel32
+EXTRALIBS = $(LIBUUID)
+
+CTESTS = \
+	ddrawmodes.c
+
+@MAKE_TEST_RULES@
+
+### Dependencies:
--- /dev/null	Sun Mar  9 04:57:43 2003
+++ dlls/ddraw/tests/ddrawmodes.c	Tue Nov 11 02:11:29 2003
@@ -0,0 +1,144 @@
+/*
+ * Unit tests for ddraw functions
+ *
+ * Copyright (C) 2003 Sami Aario
+ *
+ * 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
+ */
+
+#include <assert.h>
+#include "wine/test.h"
+#include "ddraw.h"
+
+#ifdef NONAMELESSUNION
+#define UNION_MEMBER(x, y) DUMMYUNIONNAME##x.y
+#else
+#define UNION_MEMBER(x, y) y
+#endif
+
+static LPDIRECTDRAW lpDD;
+static WNDCLASS wc;
+static HWND hwnd;
+static int modes_cnt;
+static int modes_size;
+static LPDDSURFACEDESC modes;
+
+static void createdirectdraw()
+{
+    HRESULT rc;
+    
+    wc.style = CS_HREDRAW | CS_VREDRAW;
+    wc.lpfnWndProc = DefWindowProcA;
+    wc.cbClsExtra = 0;
+    wc.cbWndExtra = 0;
+    wc.hInstance = GetModuleHandleA(0);
+    wc.hIcon = LoadIconA(wc.hInstance, IDI_APPLICATION);
+    wc.hCursor = LoadCursorA(NULL, IDC_ARROW);
+    wc.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
+    wc.lpszMenuName = NULL;
+    wc.lpszClassName = "TestWindowClass";
+    if(!RegisterClassA(&wc))
+        assert(0);
+    
+    hwnd = CreateWindowExA(0, "TestWindowClass", "TestWindowClass",
+        WS_POPUP, 0, 0,
+        GetSystemMetrics(SM_CXSCREEN),
+        GetSystemMetrics(SM_CYSCREEN),
+        NULL, NULL, GetModuleHandleA(0), NULL);
+    if (hwnd == NULL)
+        assert(0);
+    
+    ShowWindow(hwnd, SW_HIDE);
+    UpdateWindow(hwnd);
+    SetFocus(hwnd);
+    
+    rc = DirectDrawCreate(NULL, &lpDD, NULL);
+    ok(rc==DD_OK,"DirectDrawCreate returned: %lx",rc);
+}
+
+static void add_mode(LPDDSURFACEDESC lpddsd)
+{
+    if (!modes) 
+	modes = malloc((modes_size = 2) * sizeof(DDSURFACEDESC));
+    if (modes_cnt == modes_size) 
+	    modes = realloc(modes, (modes_size *= 2) * sizeof(DDSURFACEDESC));
+    assert(modes);
+    modes[modes_cnt++] = *lpddsd;
+}
+
+static void flush_modes()
+{
+    free(modes);
+    modes = 0;
+    modes_cnt = modes_size = 0;
+}
+
+HRESULT WINAPI enummodes_callback(LPDDSURFACEDESC lpddsd, LPVOID lpContext)
+{
+    trace("Width = %lx, Height = %lx, Refresh Rate = %lx\r\n",
+        lpddsd->dwWidth, lpddsd->dwHeight,
+        lpddsd->UNION_MEMBER(2, dwRefreshRate));
+    add_mode(lpddsd);
+
+    return DDENUMRET_OK;
+}
+
+void enumdisplaymodes()
+{
+    DDSURFACEDESC ddsd;
+    HRESULT rc;
+
+    ZeroMemory(&ddsd, sizeof(DDSURFACEDESC));
+    ddsd.dwSize = sizeof(DDSURFACEDESC);
+    ddsd.dwFlags = DDSD_CAPS;
+    ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+
+    rc = IDirectDraw_EnumDisplayModes(lpDD,
+        DDEDM_STANDARDVGAMODES, &ddsd, 0, enummodes_callback);
+    ok(rc==DD_OK,"EnumDisplayModes returned: %lx",rc);
+}
+
+static void setdisplaymode_tests()
+{
+    HRESULT rc;
+    int i;
+    
+    createdirectdraw();
+    enumdisplaymodes();
+    for (i = 0; i < modes_cnt; ++i)
+    {
+        rc = IDirectDraw_SetCooperativeLevel(lpDD,
+            hwnd, DDSCL_ALLOWMODEX | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
+        ok(rc==DD_OK,"SetCooperativeLevel returned: %lx",rc);
+        if (modes[i].dwFlags & DDSD_PIXELFORMAT)
+        {
+            if (modes[i].ddpfPixelFormat.dwFlags & DDPF_RGB)
+            {
+                rc = IDirectDraw_SetDisplayMode(lpDD,
+                    modes[i].dwWidth, modes[i].dwHeight,
+                    modes[i].ddpfPixelFormat.UNION_MEMBER(1, dwRGBBitCount));
+                ok(rc==DD_OK,"SetDisplayMode returned: %lx",rc);
+                rc = IDirectDraw_RestoreDisplayMode(lpDD);
+                ok(rc==DD_OK,"RestoreDisplayMode returned: %lx",rc);
+            }
+        }
+    }
+    flush_modes();
+}
+
+START_TEST(ddrawmodes)
+{
+    setdisplaymode_tests();
+}

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux