Author: greatlrd
Date: Sun Jun 10 07:41:49 2007
New Revision: 27100
URL:
http://svn.reactos.org/svn/reactos?rev=27100&view=rev
Log:
adding real testcase to GetDeviceIdentifier, we can not test everything, I leave small
code comment out for easy debuging
Modified:
trunk/rostests/dxtest/ddraw/ddraw.rbuild
trunk/rostests/dxtest/ddraw/tests/CreateDDraw.cpp
Modified: trunk/rostests/dxtest/ddraw/ddraw.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/ddraw.rbuild…
==============================================================================
--- trunk/rostests/dxtest/ddraw/ddraw.rbuild (original)
+++ trunk/rostests/dxtest/ddraw/ddraw.rbuild Sun Jun 10 07:41:49 2007
@@ -5,6 +5,7 @@
<library>kernel32</library>
<library>user32</library>
<library>gdi32</library>
+ <library>ole32</library>
<library>ddraw</library>
<library>dxguid</library>
<file>ddraw_test.cpp</file>
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 Sun Jun 10 07:41:49 2007
@@ -378,6 +378,10 @@
BOOL Test_GetDeviceIdentifier (INT* passed, INT* failed)
{
LPDIRECTDRAW7 DirectDraw;
+ DDDEVICEIDENTIFIER2 pDDDI;
+ //OLECHAR GuidStr[100];
+
+
/* Preparations */
if (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, NULL) != DD_OK)
@@ -385,6 +389,33 @@
printf("ERROR: Failed to set up ddraw\n");
return FALSE;
}
+
+ TEST ( DirectDraw->GetDeviceIdentifier(NULL, 0) == DDERR_INVALIDPARAMS );
+ TEST ( DirectDraw->GetDeviceIdentifier(NULL, ~DDGDI_GETHOSTIDENTIFIER) ==
DDERR_INVALIDPARAMS );
+ TEST ( DirectDraw->GetDeviceIdentifier(NULL, DDGDI_GETHOSTIDENTIFIER) ==
DDERR_INVALIDPARAMS );
+
+
+ memset(&pDDDI,0,sizeof(DDDEVICEIDENTIFIER2));
+ TEST ( DirectDraw->GetDeviceIdentifier(&pDDDI, 0) == DD_OK );
+
+/*
+ StringFromGUID2(pDDDI.guidDeviceIdentifier, GuidStr, 100);
+ printf("1. \n");
+ printf("szDriver : %s\n",pDDDI.szDriver);
+ printf("szDescription : %s\n",pDDDI.szDescription);
+ printf("liDriverVersion : 0x%08x . 0x%08x\n",
pDDDI.liDriverVersion.HighPart, pDDDI.liDriverVersion.LowPart);
+ printf("dwVendorId : 0x%08x\n",pDDDI.dwVendorId);
+ printf("dwDeviceId : 0x%08x\n",pDDDI.dwDeviceId);
+ printf("dwSubSysId : 0x%08x\n",pDDDI.dwSubSysId);
+ printf("dwRevision : 0x%08x\n",pDDDI.dwRevision);
+ printf("guidDeviceIdentifier : %ls\n",GuidStr);
+ printf("dwWHQLLevel : 0x%08x\n",pDDDI.dwWHQLLevel);
+*/
+
+ memset(&pDDDI,0,sizeof(DDDEVICEIDENTIFIER2));
+ TEST ( DirectDraw->GetDeviceIdentifier(&pDDDI, DDGDI_GETHOSTIDENTIFIER) == DD_OK
);
+ memset(&pDDDI,0,sizeof(DDDEVICEIDENTIFIER2));
+ TEST ( DirectDraw->GetDeviceIdentifier(&pDDDI, ~DDGDI_GETHOSTIDENTIFIER) ==
DDERR_INVALIDPARAMS );
DirectDraw->Release();