[ros-diffs] [greatlrd] 37312: port a really old test I have for ddraw.dll, this test testing see if the internal value are right when u create the com interface

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Wed Nov 12 19:48:25 CET 2008


Author: greatlrd
Date: Wed Nov 12 12:48:24 2008
New Revision: 37312

URL: http://svn.reactos.org/svn/reactos?rev=37312&view=rev
Log:
port a really old test I have for ddraw.dll, this test testing see if the internal value are right when u create the com interface

Added:
    branches/reactx/rostests/apitests/ddrawapi/
    branches/reactx/rostests/apitests/ddrawapi/ddrawapi.c   (with props)
    branches/reactx/rostests/apitests/ddrawapi/ddrawapi.h   (with props)
    branches/reactx/rostests/apitests/ddrawapi/ddrawapi.rbuild   (with props)
    branches/reactx/rostests/apitests/ddrawapi/testlist.c   (with props)
    branches/reactx/rostests/apitests/ddrawapi/tests/
    branches/reactx/rostests/apitests/ddrawapi/tests/Test_DirectDrawCreateEx.c   (with props)
Modified:
    branches/reactx/rostests/apitests/directory.rbuild

Added: branches/reactx/rostests/apitests/ddrawapi/ddrawapi.c
URL: http://svn.reactos.org/svn/reactos/branches/reactx/rostests/apitests/ddrawapi/ddrawapi.c?rev=37312&view=auto
==============================================================================
--- branches/reactx/rostests/apitests/ddrawapi/ddrawapi.c (added)
+++ branches/reactx/rostests/apitests/ddrawapi/ddrawapi.c [iso-8859-1] Wed Nov 12 12:48:24 2008
@@ -1,0 +1,21 @@
+#include "ddrawapi.h"
+
+HINSTANCE g_hInstance;
+
+BOOL
+IsFunctionPresent(LPWSTR lpszFunction)
+{
+    return TRUE;
+}
+
+int APIENTRY
+WinMain(HINSTANCE hInstance,
+        HINSTANCE hPrevInstance,
+        LPSTR     lpCmdLine,
+        int       nCmdShow)
+{
+    g_hInstance = hInstance;
+    return TestMain(L"ddrawapi", L"ddraw.dll");
+}
+
+

Propchange: branches/reactx/rostests/apitests/ddrawapi/ddrawapi.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/reactx/rostests/apitests/ddrawapi/ddrawapi.h
URL: http://svn.reactos.org/svn/reactos/branches/reactx/rostests/apitests/ddrawapi/ddrawapi.h?rev=37312&view=auto
==============================================================================
--- branches/reactx/rostests/apitests/ddrawapi/ddrawapi.h (added)
+++ branches/reactx/rostests/apitests/ddrawapi/ddrawapi.h [iso-8859-1] Wed Nov 12 12:48:24 2008
@@ -1,0 +1,21 @@
+
+
+/* Definitions */
+#define WIN32_NO_STATUS
+#define NTOS_MODE_USER
+
+/* SDK/DDK/NDK Headers. */
+#include <windows.h>
+#include <stdio.h>
+#include <ddraw.h>
+#include <ddrawi.h>
+#include <d3dhal.h>
+#include <ddrawgdi.h>
+
+
+
+
+#include "../apitest.h"
+
+
+

Propchange: branches/reactx/rostests/apitests/ddrawapi/ddrawapi.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/reactx/rostests/apitests/ddrawapi/ddrawapi.rbuild
URL: http://svn.reactos.org/svn/reactos/branches/reactx/rostests/apitests/ddrawapi/ddrawapi.rbuild?rev=37312&view=auto
==============================================================================
--- branches/reactx/rostests/apitests/ddrawapi/ddrawapi.rbuild (added)
+++ branches/reactx/rostests/apitests/ddrawapi/ddrawapi.rbuild [iso-8859-1] Wed Nov 12 12:48:24 2008
@@ -1,0 +1,16 @@
+<module name="ddrawapi" type="win32cui">
+	<include base="ddrawapi">.</include>
+	<define name="__USE_W32API" />
+	<library>apitest</library>
+	<library>kernel32</library>
+	<library>user32</library>
+	<library>gdi32</library>
+	<library>d3d8thk</library>
+	<library>dxguid</library>
+	<library>ddraw</library>
+	<library>ole32</library>
+	<library>advapi32</library>
+	<library>shell32</library>		
+	<file>ddrawapi.c</file>
+	<file>testlist.c</file>
+</module>

Propchange: branches/reactx/rostests/apitests/ddrawapi/ddrawapi.rbuild
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/reactx/rostests/apitests/ddrawapi/testlist.c
URL: http://svn.reactos.org/svn/reactos/branches/reactx/rostests/apitests/ddrawapi/testlist.c?rev=37312&view=auto
==============================================================================
--- branches/reactx/rostests/apitests/ddrawapi/testlist.c (added)
+++ branches/reactx/rostests/apitests/ddrawapi/testlist.c [iso-8859-1] Wed Nov 12 12:48:24 2008
@@ -1,0 +1,44 @@
+#ifndef _DDRAWTESTLIST_H
+#define _DDRAWTESTLIST_H
+
+#include "ddrawapi.h"
+void dump_ddrawi_directdraw_int(LPDDRAWI_DIRECTDRAW_INT lpDraw_int);
+
+/* dump all data struct when this is trun onm usefull when u debug ddraw.dll */
+#define DUMP_ON 1
+
+/* include the tests */
+#include "tests/Test_DirectDrawCreateEx.c"
+
+
+
+
+
+
+
+
+/* The List of tests */
+TESTENTRY TestList[] =
+{
+    { L"DirectDrawCreateEx", Test_DirectDrawCreateEx }
+};
+
+/* The function that gives us the number of tests */
+INT NumTests(void)
+{
+	return sizeof(TestList) / sizeof(TESTENTRY);
+}
+
+/* old debug macro and dump data */
+
+
+void dump_ddrawi_directdraw_int(LPDDRAWI_DIRECTDRAW_INT lpDraw_int)
+{
+    printf("%08lx pIntDirectDraw7->lpVtbl : 0x%p\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, lpVtbl), lpDraw_int->lpVtbl);
+    printf("%08lx pIntDirectDraw7->lpLcl : 0x%p\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, lpLcl), lpDraw_int->lpLcl );
+    printf("%08lx pIntDirectDraw7->lpLink : 0x%p\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, lpLink), lpDraw_int->lpLink );
+    printf("%08lx pIntDirectDraw7->dwIntRefCnt : 0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, dwIntRefCnt), lpDraw_int->dwIntRefCnt );
+}
+#endif
+
+/* EOF */

Propchange: branches/reactx/rostests/apitests/ddrawapi/testlist.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/reactx/rostests/apitests/ddrawapi/tests/Test_DirectDrawCreateEx.c
URL: http://svn.reactos.org/svn/reactos/branches/reactx/rostests/apitests/ddrawapi/tests/Test_DirectDrawCreateEx.c?rev=37312&view=auto
==============================================================================
--- branches/reactx/rostests/apitests/ddrawapi/tests/Test_DirectDrawCreateEx.c (added)
+++ branches/reactx/rostests/apitests/ddrawapi/tests/Test_DirectDrawCreateEx.c [iso-8859-1] Wed Nov 12 12:48:24 2008
@@ -1,0 +1,35 @@
+
+INT
+Test_DirectDrawCreateEx(PTESTINFO pti)
+{
+
+    LPDIRECTDRAW7 DirectDraw7;
+    LPDDRAWI_DIRECTDRAW_INT pIntDirectDraw7;
+    HRESULT ret;
+
+
+    /* Create DirectDraw7 */
+    ret = DirectDrawCreateEx(NULL, (VOID**)&DirectDraw7, &IID_IDirectDraw7, NULL);
+    pIntDirectDraw7 = (DDRAWI_DIRECTDRAW_INT *)DirectDraw7;
+
+    RTEST(ret == DD_OK);
+    if (ret == DD_OK)
+    {
+        RTEST(pIntDirectDraw7->lpVtbl != NULL);
+        RTEST(pIntDirectDraw7->lpLcl != NULL);
+        RTEST(pIntDirectDraw7->lpLink == NULL);
+        RTEST(pIntDirectDraw7->dwIntRefCnt == 1);
+    }
+
+#if DUMP_ON
+    if (pIntDirectDraw7 != NULL)
+    {
+        dump_ddrawi_directdraw_int(pIntDirectDraw7);
+    }
+#endif
+
+    DirectDraw7 = NULL;
+    pIntDirectDraw7 = NULL;
+    return APISTATUS_NORMAL;
+}
+

Propchange: branches/reactx/rostests/apitests/ddrawapi/tests/Test_DirectDrawCreateEx.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: branches/reactx/rostests/apitests/directory.rbuild
URL: http://svn.reactos.org/svn/reactos/branches/reactx/rostests/apitests/directory.rbuild?rev=37312&r1=37311&r2=37312&view=diff
==============================================================================
--- branches/reactx/rostests/apitests/directory.rbuild [iso-8859-1] (original)
+++ branches/reactx/rostests/apitests/directory.rbuild [iso-8859-1] Wed Nov 12 12:48:24 2008
@@ -10,7 +10,11 @@
 	<directory name="dciman32api">
 		<xi:include href="dciman32api/dciman32api.rbuild" />
 	</directory>
-
+	
+	<directory name="ddrawapi">
+		<xi:include href="ddrawapi/ddrawapi.rbuild" />
+	</directory>
+	
 	<directory name="gdi32api">
 		<xi:include href="gdi32api/gdi32api.rbuild" />
 	</directory>



More information about the Ros-diffs mailing list