Adding dx test from my win32kdxtest to win32knapi test.

win32kdxtest are more like a analysis tools to examine some struct and dumping it, 
win32knapi is true test tools 

svn path=/trunk/; revision=28279
This commit is contained in:
Magnus Olsen 2007-08-11 08:52:38 +00:00
parent 56edf011f1
commit 58272e652f
4 changed files with 23 additions and 6 deletions

View file

@ -1,5 +1,6 @@
#include "../w32knapi.h" #include "../w32knapi.h"
W32KAPI W32KAPI
HANDLE HANDLE
APIENTRY APIENTRY
@ -13,14 +14,17 @@ NtGdiDdCreateDirectDrawObject(
INT INT
Test_NtGdiDdCreateDirectDrawObject(PTESTINFO pti) Test_NtGdiDdCreateDirectDrawObject(PTESTINFO pti)
{ {
HDC hdc = CreateDCW(L"Display",NULL,NULL,NULL); HANDLE hDirectDraw;
HDC hdc = CreateDCW(L"DISPLAY",NULL,NULL,NULL);
ASSERT1(hdc != NULL); ASSERT1(hdc != NULL);
/* Test ReactX */
RTEST(NtGdiDdCreateDirectDrawObject(NULL) == NULL); RTEST(NtGdiDdCreateDirectDrawObject(NULL) == NULL);
RTEST((hDirectDraw=NtGdiDdCreateDirectDrawObject(hdc)) != NULL);
TEST(NtGdiDdCreateDirectDrawObject(hdc) != NULL); /* Cleanup ReactX setup */
DeleteDC(hdc); DeleteDC(hdc);
Syscall(L"NtGdiDdDeleteDirectDrawObject", 1, &hDirectDraw);
return APISTATUS_NORMAL; return APISTATUS_NORMAL;
} }

View file

@ -13,7 +13,19 @@ NtGdiDdDeleteDirectDrawObject(
INT INT
Test_NtGdiDdDeleteDirectDrawObject(PTESTINFO pti) Test_NtGdiDdDeleteDirectDrawObject(PTESTINFO pti)
{ {
TEST(NtGdiDdDeleteDirectDrawObject(NULL) == 0); HANDLE hDirectDraw;
HDC hdc = CreateDCW(L"DISPLAY",NULL,NULL,NULL);
ASSERT1(hdc != NULL);
/* Test ReactX */
RTEST(NtGdiDdDeleteDirectDrawObject(NULL) == FALSE);
RTEST((hDirectDraw=NtGdiDdCreateDirectDrawObject(hdc)) != NULL);
ASSERT1(hDirectDraw != NULL);
RTEST(NtGdiDdDeleteDirectDrawObject(hDirectDraw) == TRUE);
/* Cleanup ReactX setup */
DeleteDC(hdc);
Syscall(L"NtGdiDdDeleteDirectDrawObject", 1, &hDirectDraw);
return APISTATUS_NORMAL; return APISTATUS_NORMAL;
} }

View file

@ -20,8 +20,9 @@ TESTENTRY TestList[] =
{ {
/* DirectDraw */ /* DirectDraw */
{ L"NtGdiDdCreateDirectDrawObject", Test_NtGdiDdCreateDirectDrawObject }, { L"NtGdiDdCreateDirectDrawObject", Test_NtGdiDdCreateDirectDrawObject },
{ L"NtGdiDdDeleteDirectDrawObject", Test_NtGdiDdDeleteDirectDrawObject },
{ L"NtGdiDdQueryDirectDrawObject", Test_NtGdiDdQueryDirectDrawObject }, { L"NtGdiDdQueryDirectDrawObject", Test_NtGdiDdQueryDirectDrawObject },
{ L"NtGdiDdDeleteDirectDrawObject", Test_NtGdiDdDeleteDirectDrawObject },
/* ntgdi */ /* ntgdi */
{ L"NtGdiArcInternal", Test_NtGdiArcInternal }, { L"NtGdiArcInternal", Test_NtGdiArcInternal },

View file

@ -153,7 +153,7 @@ WinMain(HINSTANCE hInstance,
printf("Win32k native API test\n"); printf("Win32k native API test\n");
/* Convert to gui thread */ /* Convert to gui thread */
IsGUIThread(TRUE); // IsGUIThread(TRUE); <- does not exists on win2k
if (!InitOsVersion()) if (!InitOsVersion())
{ {