Author: mbosma
Date: Sun May 13 20:37:58 2007
New Revision: 26755
URL:
http://svn.reactos.org/svn/reactos?rev=26755&view=rev
Log:
Beginning of CreateSurface test.
Added:
trunk/rostests/dxtest/ddraw/tests/CreateSurface.cpp (with props)
Modified:
trunk/rostests/dxtest/ddraw/testlist.cpp
trunk/rostests/dxtest/ddraw/tests/DisplayModes.cpp
Modified: trunk/rostests/dxtest/ddraw/testlist.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/testlist.cpp…
==============================================================================
--- trunk/rostests/dxtest/ddraw/testlist.cpp (original)
+++ trunk/rostests/dxtest/ddraw/testlist.cpp Sun May 13 20:37:58 2007
@@ -7,13 +7,15 @@
/* include the tests */
#include "tests/CreateDDraw.cpp"
#include "tests/DisplayModes.cpp"
+#include "tests/CreateSurface.cpp"
/* The List of tests */
TEST TestList[] =
{
{ "DirectDrawCreate(Ex)", Test_CreateDDraw },
{ "IDirectDraw::SetCooperativeLevel", Test_SetCooperativeLevel },
- // { "IDirectDraw::EnumDisplayModes/SetDisplayMode", Test_DisplayModes } //
uncomment this test if you have enough time and patience
+ // { "IDirectDraw::EnumDisplayModes/SetDisplayMode", Test_DisplayModes }, //
uncomment this test if you have enough time and patience
+ { "IDirectDraw::CreateSurface", Test_CreateSurface }
};
/* The function that gives us the number of tests */
Added: trunk/rostests/dxtest/ddraw/tests/CreateSurface.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/tests/Create…
==============================================================================
--- trunk/rostests/dxtest/ddraw/tests/CreateSurface.cpp (added)
+++ trunk/rostests/dxtest/ddraw/tests/CreateSurface.cpp Sun May 13 20:37:58 2007
@@ -1,0 +1,46 @@
+
+HWND CreateBasicWindow (VOID);
+
+BOOL Test_CreateSurface (INT* passed, INT* failed)
+{
+ LPDIRECTDRAW7 DirectDraw;
+ LPDIRECTDRAWSURFACE7 DirectDrawSurface;
+ HWND hwnd;
+
+ /* Preparations */
+ if (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, NULL) != DD_OK)
+ {
+ printf("ERROR: Failed to set up ddraw\n");
+ return FALSE;
+ }
+
+ if(!( hwnd = CreateBasicWindow() ))
+ {
+ printf("ERROR: Failed to create window\n");
+ DirectDraw->Release();
+ return FALSE;
+ }
+
+ if (DirectDraw->SetCooperativeLevel (hwnd, DDSCL_NORMAL) != DD_OK)
+ {
+ printf("ERROR: you not set cooperative level\n");
+ DirectDraw->Release();
+ return 0;
+ }
+
+ /* The Test */
+
+ DDSURFACEDESC2 Desc = { 0 };
+
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface,
(IUnknown*)0xdeadbeef) == CLASS_E_NOAGGREGATION );
+ TEST ( DirectDraw->CreateSurface(NULL, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS );
+ TEST ( DirectDraw->CreateSurface(&Desc, NULL, NULL) == DDERR_INVALIDPARAMS );
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS );
+
+ Desc.dwSize = sizeof (DDSURFACEDESC2);
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS );
+
+ DirectDraw->Release();
+
+ return TRUE;
+}
Propchange: trunk/rostests/dxtest/ddraw/tests/CreateSurface.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/rostests/dxtest/ddraw/tests/CreateSurface.cpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: trunk/rostests/dxtest/ddraw/tests/DisplayModes.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/tests/Displa…
==============================================================================
--- trunk/rostests/dxtest/ddraw/tests/DisplayModes.cpp (original)
+++ trunk/rostests/dxtest/ddraw/tests/DisplayModes.cpp Sun May 13 20:37:58 2007
@@ -42,6 +42,8 @@
TEST ( DirectDraw->SetDisplayMode (800, 600, 0, 0, 0) == DD_OK );
TEST ( DirectDraw->SetDisplayMode (0, 0, 16, 0, 0) == DD_OK );
+ // does this change the display mode to DDSCL_EXCLUSIVE ?
+
// Now try getting vaild modes from driver
TEST (DirectDraw->EnumDisplayModes(DDEDM_STANDARDVGAMODES, NULL, (PVOID)&Context,
NULL) == DDERR_INVALIDPARAMS);
TEST (DirectDraw->EnumDisplayModes(0, NULL, (PVOID)&Context,
(LPDDENUMMODESCALLBACK2)DummyEnumDisplayModes) == DD_OK );