Author: mbosma
Date: Thu May 17 00:54:20 2007
New Revision: 26812
URL:
http://svn.reactos.org/svn/reactos?rev=26812&view=rev
Log:
- Comment out tests which works does not work for me under xp.
- Release returns ref count and no HRESULT (my bad).
Modified:
trunk/rostests/dxtest/ddraw/tests/CreateSurface.cpp
Modified: trunk/rostests/dxtest/ddraw/tests/CreateSurface.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/tests/Create…
==============================================================================
--- trunk/rostests/dxtest/ddraw/tests/CreateSurface.cpp (original)
+++ trunk/rostests/dxtest/ddraw/tests/CreateSurface.cpp Thu May 17 00:54:20 2007
@@ -44,11 +44,79 @@
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
+ TEST ( DirectDrawSurface && DirectDrawSurface->Release() == 0 );
+ DirectDrawSurface = NULL;
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_3DDEVICE;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
+ Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
+ TEST ( DirectDrawSurface && DirectDrawSurface->Release() == 0 );
+ DirectDrawSurface = NULL;
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_ALLOCONLOAD;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_ALPHA;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_COMPLEX;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_FLIP;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_FRONTBUFFER;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_HWCODEC;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
+ Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
+ TEST ( DirectDrawSurface && DirectDrawSurface->Release() == 0 );
+ DirectDrawSurface = NULL;
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_LIVEVIDEO;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
+ Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
+ TEST ( DirectDrawSurface && DirectDrawSurface->Release() == 0 );
+ DirectDrawSurface = NULL;
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_LOCALVIDMEM;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_MIPMAP;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_MODEX;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
+ Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
DirectDrawSurface = NULL;
Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_3DDEVICE;
+ Desc.ddsCaps.dwCaps = DDSCAPS_NONLOCALVIDMEM;
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
+
+ Desc.dwFlags = DDSD_CAPS;
+ Desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
@@ -56,74 +124,6 @@
DirectDrawSurface = NULL;
Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_ALLOCONLOAD;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_ALPHA;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_COMPLEX;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_FLIP;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_FRONTBUFFER;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_HWCODEC;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
- Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
- TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
- DirectDrawSurface = NULL;
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_LIVEVIDEO;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
- Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
- TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
- DirectDrawSurface = NULL;
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_LOCALVIDMEM;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_MIPMAP;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_MODEX;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
- Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
- TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
- DirectDrawSurface = NULL;
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_NONLOCALVIDMEM;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
-
- Desc.dwFlags = DDSD_CAPS;
- Desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
- Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
- TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
- DirectDrawSurface = NULL;
-
- Desc.dwFlags = DDSD_CAPS;
Desc.ddsCaps.dwCaps = DDSCAPS_OPTIMIZED;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDCAPS);
@@ -131,9 +131,11 @@
Desc.ddsCaps.dwCaps = DDSCAPS_OVERLAY;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
- TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
- TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
- DirectDrawSurface = NULL;
+#if 0
+ TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
+ TEST ( DirectDrawSurface && DirectDrawSurface->Release() == 0 );
+ DirectDrawSurface = NULL;
+#endif
Desc.dwFlags = DDSD_CAPS;
Desc.ddsCaps.dwCaps = DDSCAPS_OWNDC;
@@ -146,7 +148,7 @@
Desc.dwFlags = DDSD_CAPS;
Desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK
);
- TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
+ TEST ( DirectDrawSurface && DirectDrawSurface->Release() == 0 );
DirectDrawSurface = NULL;
Desc.dwFlags = DDSD_CAPS;
@@ -154,7 +156,7 @@
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
- TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
+ TEST ( DirectDrawSurface && DirectDrawSurface->Release() == 0 );
DirectDrawSurface = NULL;
Desc.dwFlags = DDSD_CAPS;
@@ -162,7 +164,7 @@
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
- TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
+ TEST ( DirectDrawSurface && DirectDrawSurface->Release() == 0 );
DirectDrawSurface = NULL;
DirectDrawSurface = NULL;
@@ -171,7 +173,7 @@
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK
);
- TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
+ TEST ( DirectDrawSurface && DirectDrawSurface->Release() == 0 );
DirectDrawSurface = NULL;
Desc.dwFlags = DDSD_CAPS;
@@ -179,7 +181,7 @@
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
- TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
+ TEST ( DirectDrawSurface && DirectDrawSurface->Release() == 0 );
DirectDrawSurface = NULL;
Desc.dwFlags = DDSD_CAPS;
@@ -187,7 +189,7 @@
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) ==
DDERR_INVALIDPARAMS);
Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK);
- TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
+ TEST ( DirectDrawSurface && DirectDrawSurface->Release() == 0 );
DirectDrawSurface = NULL;
Desc.dwFlags = DDSD_CAPS;