Author: mbosma
Date: Sat May 12 23:43:01 2007
New Revision: 26739
URL:
http://svn.reactos.org/svn/reactos?rev=26739&view=rev
Log:
Start of ddraw test case.
Added:
trunk/rostests/dxtest/ddraw/ddraw.rbuild
trunk/rostests/dxtest/ddraw/ddraw_test.c (with props)
trunk/rostests/dxtest/ddraw/ddrawtest.h (with props)
trunk/rostests/dxtest/ddraw/testlist.cpp (with props)
trunk/rostests/dxtest/ddraw/tests/
trunk/rostests/dxtest/ddraw/tests/CreateDDraw.cpp (with props)
Added: 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 (added)
+++ trunk/rostests/dxtest/ddraw/ddraw.rbuild Sat May 12 23:43:01 2007
@@ -1,0 +1,12 @@
+<module name="ddraw_test" type="win32cui"
allowwarnings="true">
+ <include base="ddraw_test">.</include>
+ <define name="__USE_W32API" />
+ <define name="_WIN32_WINNT">0x0501</define>
+ <library>kernel32</library>
+ <library>user32</library>
+ <library>gdi32</library>
+ <library>ddraw</library>
+ <library>dxguid</library>
+ <file>ddraw_test.c</file>
+ <file>testlist.cpp</file>
+</module>
Added: trunk/rostests/dxtest/ddraw/ddraw_test.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/ddraw_test.c…
==============================================================================
--- trunk/rostests/dxtest/ddraw/ddraw_test.c (added)
+++ trunk/rostests/dxtest/ddraw/ddraw_test.c Sat May 12 23:43:01 2007
@@ -1,0 +1,51 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "ddrawtest.h"
+
+INT NumTests(void);
+
+int main(int argc, char *argv[])
+{
+ INT Num = NumTests();
+ INT i, j;
+ INT passed, failed, opassed, ofailed;
+
+ opassed = 0;
+ ofailed = 0;
+ printf("DirectDraw tests\n");
+ if (argc > 1)
+ {
+ for (i = 1; i < argc; i++)
+ {
+ for (j = 0; j < NumTests(); j++)
+ {
+ if (stricmp(argv[i], TestList[j].Test) == 0)
+ {
+ passed = 0;
+ failed = 0;
+ TestList[j].Proc(&passed, &failed);
+ opassed += passed;
+ ofailed += failed;
+ printf(" tests: %d, passed: %d, failed: %d\n\n", passed+failed, passed,
failed);
+ }
+ }
+ }
+ }
+ else
+ {
+ for (i = 0; i < Num; i++)
+ {
+ passed = 0;
+ failed = 0;
+ printf("Test: %s\n", TestList[i].Test);
+ TestList[i].Proc(&passed, &failed);
+ opassed += passed;
+ ofailed += failed;
+ printf(" tests: %d, passed: %d, failed: %d\n\n", passed+failed, passed,
failed);
+ }
+ }
+ printf("\nOverall tests: %d, passed: %d, failed: %d\n", opassed+ofailed,
opassed, ofailed);
+
+ return ofailed;
+}
Propchange: trunk/rostests/dxtest/ddraw/ddraw_test.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/rostests/dxtest/ddraw/ddraw_test.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: 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 (added)
+++ trunk/rostests/dxtest/ddraw/ddrawtest.h Sat May 12 23:43:01 2007
@@ -1,0 +1,34 @@
+#ifndef _DDRAWTEST_H
+#define _DDRAWTEST_H
+
+#define WINVER 0x501
+
+#include <stdio.h>
+#include <windows.h>
+#include <ddraw.h>
+
+#define TEST(x) \
+ if (x)\
+ {\
+ (*passed)++;\
+ } else {\
+ (*failed)++;\
+ printf("Test failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\
+ };
+
+
+/* The type definitions */
+typedef BOOL (*TESTPROC)(INT*, INT*);
+
+typedef struct tagTEST
+{
+ CHAR* Test;
+ TESTPROC Proc;
+} TEST, *PTEST;
+
+
+extern TEST TestList[];
+
+#endif /* _DDRAWTEST_H */
+
+/* EOF */
Propchange: trunk/rostests/dxtest/ddraw/ddrawtest.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/rostests/dxtest/ddraw/ddrawtest.h
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: 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 (added)
+++ trunk/rostests/dxtest/ddraw/testlist.cpp Sat May 12 23:43:01 2007
@@ -1,0 +1,23 @@
+#ifndef _DDRAWTESTLIST_H
+#define _DDRAWTESTLIST_H
+
+#include "ddrawtest.h"
+
+/* include the tests */
+#include "tests/CreateDDraw.cpp"
+
+/* The List of tests */
+TEST TestList[] =
+{
+ { "CreateDDraw", Test_CreateDDraw }
+};
+
+/* The function that gives us the number of tests */
+extern "C" INT NumTests(void)
+{
+ return sizeof(TestList) / sizeof(TEST);
+}
+
+#endif /* _DDRAWTESTLIST_H */
+
+/* EOF */
Propchange: trunk/rostests/dxtest/ddraw/testlist.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/rostests/dxtest/ddraw/testlist.cpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: 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 (added)
+++ trunk/rostests/dxtest/ddraw/tests/CreateDDraw.cpp Sat May 12 23:43:01 2007
@@ -1,0 +1,19 @@
+#include "ddrawtest.h"
+
+PCHAR DDErrorString (HRESULT hResult);
+
+BOOL Test_CreateDDraw (INT* passed, INT* failed)
+{
+ LPDIRECTDRAW7 DirectDraw;
+ IDirectDraw* DirectDraw2;
+
+ // FIXME: Test first parameter
+
+ TEST (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7,
(IUnknown*)0xdeadbeef) == CLASS_E_NOAGGREGATION);
+ TEST (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw4, NULL) ==
DDERR_INVALIDPARAMS);
+ TEST (DirectDrawCreateEx(NULL, NULL, IID_IDirectDraw7, NULL) == DDERR_INVALIDPARAMS);
+ TEST (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, NULL) ==
DD_OK);
+ TEST (DirectDrawCreate(NULL ,&DirectDraw2, NULL) == DD_OK);
+
+ return TRUE;
+}
Propchange: trunk/rostests/dxtest/ddraw/tests/CreateDDraw.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/rostests/dxtest/ddraw/tests/CreateDDraw.cpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision