mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 00:45:49 +00:00
[WIN32KNT_APITEST:NTDD] Improve failure handling
And remove comments about ReactX. ROSTESTS-315
This commit is contained in:
parent
ba884619b0
commit
92a9a445dd
3 changed files with 62 additions and 28 deletions
|
@ -11,13 +11,30 @@ START_TEST(NtGdiDdCreateDirectDrawObject)
|
||||||
{
|
{
|
||||||
HANDLE hDirectDraw;
|
HANDLE hDirectDraw;
|
||||||
HDC hdc = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
|
HDC hdc = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
|
||||||
ok(hdc != NULL, "\n");
|
ok(hdc != NULL, "CreateDCW() failed\n");
|
||||||
|
|
||||||
/* Test ReactX */
|
hDirectDraw = NtGdiDdCreateDirectDrawObject(NULL);
|
||||||
ok(NtGdiDdCreateDirectDrawObject(NULL) == NULL, "\n");
|
ok(hDirectDraw == NULL,
|
||||||
ok((hDirectDraw = NtGdiDdCreateDirectDrawObject(hdc)) != NULL, "\n");
|
"NtGdiDdCreateDirectDrawObject() succeeded on NULL device context\n");
|
||||||
|
if (hDirectDraw != NULL)
|
||||||
|
{
|
||||||
|
ok(NtGdiDdDeleteDirectDrawObject(hDirectDraw) == TRUE,
|
||||||
|
"NtGdiDdDeleteDirectDrawObject() failed on unwanted object\n");
|
||||||
|
}
|
||||||
|
|
||||||
/* Cleanup ReactX setup */
|
if (hdc == NULL)
|
||||||
DeleteDC(hdc);
|
{
|
||||||
NtGdiDdDeleteDirectDrawObject(hDirectDraw);
|
skip("No DC\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
hDirectDraw = NtGdiDdCreateDirectDrawObject(hdc);
|
||||||
|
ok(hDirectDraw != NULL, "NtGdiDdCreateDirectDrawObject() failed\n");
|
||||||
|
if (hDirectDraw != NULL)
|
||||||
|
{
|
||||||
|
ok(NtGdiDdDeleteDirectDrawObject(hDirectDraw) == TRUE,
|
||||||
|
"NtGdiDdDeleteDirectDrawObject() failed\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
ok(DeleteDC(hdc) != 0, "DeleteDC() failed\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,14 +11,31 @@ START_TEST(NtGdiDdDeleteDirectDrawObject)
|
||||||
{
|
{
|
||||||
HANDLE hDirectDraw;
|
HANDLE hDirectDraw;
|
||||||
HDC hdc = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
|
HDC hdc = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
|
||||||
ok(hdc != NULL, "\n");
|
ok(hdc != NULL, "CreateDCW() failed\n");
|
||||||
|
|
||||||
/* Test ReactX */
|
ok(NtGdiDdDeleteDirectDrawObject(NULL) == FALSE,
|
||||||
ok(NtGdiDdDeleteDirectDrawObject(NULL) == FALSE, "\n");
|
"NtGdiDdDeleteDirectDrawObject() succeeded on NULL object\n");
|
||||||
ok((hDirectDraw=NtGdiDdCreateDirectDrawObject(hdc)) != NULL, "\n");
|
|
||||||
ok(NtGdiDdDeleteDirectDrawObject(hDirectDraw) == TRUE, "\n");
|
|
||||||
|
|
||||||
/* Cleanup ReactX setup */
|
if (hdc == NULL)
|
||||||
DeleteDC(hdc);
|
{
|
||||||
NtGdiDdDeleteDirectDrawObject(hDirectDraw);
|
skip("No DC\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
hDirectDraw = NtGdiDdCreateDirectDrawObject(hdc);
|
||||||
|
ok(hDirectDraw != NULL, "NtGdiDdCreateDirectDrawObject() failed\n");
|
||||||
|
|
||||||
|
if (hDirectDraw == NULL)
|
||||||
|
{
|
||||||
|
skip("No DirectDrawObject\n");
|
||||||
|
ok(DeleteDC(hdc) != 0, "DeleteDC() failed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ok(NtGdiDdDeleteDirectDrawObject(hDirectDraw) == TRUE,
|
||||||
|
"NtGdiDdDeleteDirectDrawObject() failed on existing object\n");
|
||||||
|
ok(NtGdiDdDeleteDirectDrawObject(hDirectDraw) == FALSE,
|
||||||
|
"NtGdiDdDeleteDirectDrawObject() succeeded on deleted object\n");
|
||||||
|
|
||||||
|
ok(DeleteDC(hdc) != 0, "DeleteDC() failed\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*/
|
*/
|
||||||
START_TEST(NtGdiDdQueryDirectDrawObject)
|
START_TEST(NtGdiDdQueryDirectDrawObject)
|
||||||
{
|
{
|
||||||
HANDLE hDirectDraw = NULL;
|
HANDLE hDirectDraw;
|
||||||
DD_HALINFO *pHalInfo = NULL;
|
DD_HALINFO *pHalInfo = NULL;
|
||||||
DWORD *pCallBackFlags = NULL;
|
DWORD *pCallBackFlags = NULL;
|
||||||
LPD3DNTHAL_CALLBACKS puD3dCallbacks = NULL;
|
LPD3DNTHAL_CALLBACKS puD3dCallbacks = NULL;
|
||||||
|
@ -68,16 +68,8 @@ START_TEST(NtGdiDdQueryDirectDrawObject)
|
||||||
ASSERT(hdc != NULL);
|
ASSERT(hdc != NULL);
|
||||||
|
|
||||||
|
|
||||||
/* Create ReactX handle */
|
hDirectDraw = NtGdiDdCreateDirectDrawObject(hdc);
|
||||||
hDirectDraw = (HANDLE) NtGdiDdCreateDirectDrawObject(hdc);
|
|
||||||
RTEST(hDirectDraw != NULL);
|
RTEST(hDirectDraw != NULL);
|
||||||
if (hDirectDraw == NULL)
|
|
||||||
{
|
|
||||||
DeleteDC(hdc);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Start Test ReactX NtGdiDdQueryDirectDrawObject function */
|
|
||||||
|
|
||||||
/* testing OsThunkDdQueryDirectDrawObject( NULL, .... */
|
/* testing OsThunkDdQueryDirectDrawObject( NULL, .... */
|
||||||
RTEST(NtGdiDdQueryDirectDrawObject( NULL, pHalInfo,
|
RTEST(NtGdiDdQueryDirectDrawObject( NULL, pHalInfo,
|
||||||
|
@ -98,6 +90,13 @@ START_TEST(NtGdiDdQueryDirectDrawObject)
|
||||||
RTEST(puNumHeaps == NULL);
|
RTEST(puNumHeaps == NULL);
|
||||||
RTEST(puvmList == NULL);
|
RTEST(puvmList == NULL);
|
||||||
|
|
||||||
|
if (hDirectDraw == NULL)
|
||||||
|
{
|
||||||
|
skip("No DirectDrawObject\n");
|
||||||
|
ok(DeleteDC(hdc) != 0, "DeleteDC() failed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* testing NtGdiDdQueryDirectDrawObject( hDirectDrawLocal, NULL, .... */
|
/* testing NtGdiDdQueryDirectDrawObject( hDirectDrawLocal, NULL, .... */
|
||||||
RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo,
|
RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo,
|
||||||
pCallBackFlags, puD3dCallbacks,
|
pCallBackFlags, puD3dCallbacks,
|
||||||
|
@ -797,7 +796,8 @@ START_TEST(NtGdiDdQueryDirectDrawObject)
|
||||||
* puFourCC
|
* puFourCC
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Cleanup ReactX setup */
|
ok(NtGdiDdDeleteDirectDrawObject(hDirectDraw) == TRUE,
|
||||||
DeleteDC(hdc);
|
"NtGdiDdDeleteDirectDrawObject() failed\n");
|
||||||
NtGdiDdDeleteDirectDrawObject(hDirectDraw);
|
|
||||||
|
ok(DeleteDC(hdc) != 0, "DeleteDC() failed\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue