Author: greatlrd
Date: Thu Jun 7 23:03:11 2007
New Revision: 27059
URL:
http://svn.reactos.org/svn/reactos?rev=27059&view=rev
Log:
adding a big freq test
Modified:
trunk/rostests/dxtest/ddraw/ddrawtest.h
trunk/rostests/dxtest/ddraw/testlist.cpp
trunk/rostests/dxtest/ddraw/tests/CreateDDraw.cpp
trunk/rostests/dxtest/ddraw/tests/DisplayModes.cpp
Modified: trunk/rostests/dxtest/ddraw/ddrawtest.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/ddrawtest.h?…
==============================================================================
--- trunk/rostests/dxtest/ddraw/ddrawtest.h (original)
+++ trunk/rostests/dxtest/ddraw/ddrawtest.h Thu Jun 7 23:03:11 2007
@@ -5,7 +5,11 @@
#include <stdio.h>
#include <windows.h>
+#include <stdio.h>
#include <ddraw.h>
+#include <ddrawi.h>
+#include <d3dhal.h>
+#include <ddrawgdi.h>
#define TEST(x) \
if (x)\
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 Jun 7 23:03:11 2007
@@ -13,6 +13,7 @@
TEST TestList[] =
{
{ "IDirectDraw: COM Stuff", Test_CreateDDraw },
+ { "IDirectDraw: Display Frequency", Test_GetMonitorFrequency },
{ "IDirectDraw: Display Modes", Test_DisplayModes },
{ "IDirectDraw: Available Video Memory", Test_GetAvailableVidMem },
{ "IDirectDraw: GetFourCC", Test_GetFourCCCodes },
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 Jun 7 23:03:11 2007
@@ -132,6 +132,9 @@
return TRUE;
}
+
+
+
LONG WINAPI BasicWindowProc (HWND hwnd, UINT message, UINT wParam, LONG lParam)
{
switch (message)
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 Thu Jun 7 23:03:11 2007
@@ -81,3 +81,51 @@
return TRUE;
}
+
+
+BOOL Test_GetMonitorFrequency (INT* passed, INT* failed)
+{
+ LPDIRECTDRAW7 DirectDraw;
+ LPDDRAWI_DIRECTDRAW_INT This;
+
+ /* Preparations */
+ if (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, NULL) != DD_OK)
+ {
+ printf("ERROR: Failed to set up ddraw\n");
+ return FALSE;
+ }
+ This = (LPDDRAWI_DIRECTDRAW_INT)DirectDraw;
+
+ /* Here we go */
+ DWORD lpFreq;
+ DWORD temp;
+ HRESULT retVal;
+ TEST (DirectDraw->GetMonitorFrequency((PDWORD)0xdeadbeef) == DDERR_INVALIDPARAMS);
+ TEST (DirectDraw->GetMonitorFrequency(NULL) == DDERR_INVALIDPARAMS);
+
+ /* This test depns on which graphice card you have */
+ retVal = DirectDraw->GetMonitorFrequency((PDWORD)&lpFreq);
+
+ if ( retVal == DDERR_UNSUPPORTED)
+ {
+ retVal = DD_OK;
+ }
+ TEST ( retVal == DD_OK);
+
+ /* hacking testing */
+
+ /* shall return DDERR_UNSUPPORTED */
+ This->lpLcl->lpGbl->dwMonitorFrequency = 0;
+ TEST (DirectDraw->GetMonitorFrequency(&temp) == DDERR_UNSUPPORTED);
+
+ /* shall return DD_OK */
+ This->lpLcl->lpGbl->dwMonitorFrequency = 85;
+ TEST (DirectDraw->GetMonitorFrequency(&temp) == DD_OK);
+
+ /* restore */
+ This->lpLcl->lpGbl->dwMonitorFrequency = lpFreq;
+
+ DirectDraw->Release();
+
+ return TRUE;
+}