Author: mbosma
Date: Thu May 17 02:19:07 2007
New Revision: 26815
URL:
http://svn.reactos.org/svn/reactos?rev=26815&view=rev
Log:
GetAvailableVidMem-Test
Modified:
trunk/rostests/dxtest/ddraw/testlist.cpp
trunk/rostests/dxtest/ddraw/tests/CreateDDraw.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 Thu May 17 02:19:07 2007
@@ -14,6 +14,7 @@
{
{ "IDirectDraw: COM Stuff", Test_CreateDDraw },
{ "IDirectDraw: Display Modes", Test_DisplayModes },
+ { "IDirectDraw: Available Video Memory", Test_GetAvailableVidMem },
{ "IDirectDraw: Cooperative Levels", Test_SetCooperativeLevel },
{ "IDirectDraw: CreateSurface", Test_CreateSurface },
};
Modified: trunk/rostests/dxtest/ddraw/tests/CreateDDraw.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/tests/Create…
==============================================================================
--- trunk/rostests/dxtest/ddraw/tests/CreateDDraw.cpp (original)
+++ trunk/rostests/dxtest/ddraw/tests/CreateDDraw.cpp Thu May 17 02:19:07 2007
@@ -79,6 +79,32 @@
return TRUE;
}
+BOOL Test_GetAvailableVidMem (INT* passed, INT* failed)
+{
+ LPDIRECTDRAW7 DirectDraw;
+
+ /* Preparations */
+ if (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, NULL) != DD_OK)
+ {
+ printf("ERROR: Failed to set up ddraw\n");
+ return FALSE;
+ }
+
+ /* Here we go */
+ DWORD Total, Free;
+ DDSCAPS2 Caps = { 0 };
+ TEST (DirectDraw->GetAvailableVidMem(&Caps, NULL, NULL) == DDERR_INVALIDPARAMS);
+ TEST (DirectDraw->GetAvailableVidMem(NULL, &Total, &Free) ==
DDERR_INVALIDPARAMS);
+ TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK
&& Total == 0 && Free == 0 );
+
+ Caps.dwCaps = DDSCAPS_VIDEOMEMORY;
+ TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );
+
+ DirectDraw->Release();
+
+ return TRUE;
+}
+
LONG WINAPI BasicWindowProc (HWND hwnd, UINT message, UINT wParam, LONG lParam)
{
switch (message)