mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 20:18:22 +00:00
[GDI32_APITEST] Remove broken EngDeleteSemaphore.c (#655)
- Checks are actually uses-after-free, "by design" :-< - Actual test code duplicates EngCreateSemaphore.c, EngAcquireSemaphore.c and EngReleaseSemaphore.c.
This commit is contained in:
parent
d0632b0bca
commit
155bd681a0
3 changed files with 0 additions and 70 deletions
|
@ -21,7 +21,6 @@ list(APPEND SOURCE
|
||||||
DPtoLP.c
|
DPtoLP.c
|
||||||
EngAcquireSemaphore.c
|
EngAcquireSemaphore.c
|
||||||
EngCreateSemaphore.c
|
EngCreateSemaphore.c
|
||||||
EngDeleteSemaphore.c
|
|
||||||
EngReleaseSemaphore.c
|
EngReleaseSemaphore.c
|
||||||
EnumFontFamilies.c
|
EnumFontFamilies.c
|
||||||
ExcludeClipRect.c
|
ExcludeClipRect.c
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
/*
|
|
||||||
* PROJECT: ReactOS api tests
|
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
|
||||||
* PURPOSE: Test for EngDeleteSemaphore
|
|
||||||
* PROGRAMMERS: Magnus Olsen
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "precomp.h"
|
|
||||||
|
|
||||||
void Test_EngDeleteSemaphore()
|
|
||||||
{
|
|
||||||
HSEMAPHORE hsem;
|
|
||||||
PRTL_CRITICAL_SECTION lpcrit;
|
|
||||||
|
|
||||||
/* test Create then delete */
|
|
||||||
hsem = EngCreateSemaphore();
|
|
||||||
ok(hsem != NULL, "EngCreateSemaphore failed\n");
|
|
||||||
if (!hsem) return;
|
|
||||||
lpcrit = (PRTL_CRITICAL_SECTION)hsem;
|
|
||||||
EngDeleteSemaphore(hsem);
|
|
||||||
|
|
||||||
// ok(lpcrit->LockCount > 0); doesn't work on XP
|
|
||||||
ok(lpcrit->RecursionCount == 0, "lpcrit->RecursionCount=%ld\n", lpcrit->RecursionCount);
|
|
||||||
ok(lpcrit->OwningThread == 0, "lpcrit->OwningThread=%p\n", lpcrit->OwningThread);
|
|
||||||
ok(lpcrit->LockSemaphore == 0, "lpcrit->LockSemaphore=%p\n", lpcrit->LockSemaphore);
|
|
||||||
ok(lpcrit->SpinCount == 0, "lpcrit->SpinCount=%ld\n", lpcrit->SpinCount);
|
|
||||||
|
|
||||||
//ok(lpcrit->DebugInfo != NULL, "no DebugInfo\n");
|
|
||||||
if (lpcrit->DebugInfo)
|
|
||||||
{
|
|
||||||
ok(lpcrit->DebugInfo->Type != 0, "DebugInfo->Type=%d\n", lpcrit->DebugInfo->Type);
|
|
||||||
ok(lpcrit->DebugInfo->CreatorBackTraceIndex != 0, "DebugInfo->CreatorBackTraceIndex=%d\n", lpcrit->DebugInfo->CreatorBackTraceIndex);
|
|
||||||
//ok(lpcrit->DebugInfo->EntryCount != 0, "DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount);
|
|
||||||
//ok(lpcrit->DebugInfo->ContentionCount != 0, "DebugInfo->ContentionCount=%ld\n", lpcrit->DebugInfo->ContentionCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* test EngAcquireSemaphore and release it, then delete it */
|
|
||||||
hsem = EngCreateSemaphore();
|
|
||||||
ok(hsem != NULL, "EngCreateSemaphore failed\n");
|
|
||||||
if (!hsem) return;
|
|
||||||
lpcrit = (PRTL_CRITICAL_SECTION)hsem;
|
|
||||||
|
|
||||||
EngAcquireSemaphore(hsem);
|
|
||||||
EngReleaseSemaphore(hsem);
|
|
||||||
EngDeleteSemaphore(hsem);
|
|
||||||
|
|
||||||
//ok(lpcrit->LockCount > 0, "lpcrit->LockCount=%ld\n", lpcrit->LockCount);
|
|
||||||
ok(lpcrit->RecursionCount == 0, "lpcrit->RecursionCount=%ld\n", lpcrit->RecursionCount);
|
|
||||||
ok(lpcrit->OwningThread == 0, "lpcrit->OwningThread=%p\n", lpcrit->OwningThread);
|
|
||||||
ok(lpcrit->LockSemaphore == 0, "lpcrit->LockSemaphore=%p\n", lpcrit->LockSemaphore);
|
|
||||||
ok(lpcrit->SpinCount == 0, "lpcrit->SpinCount=%ld\n", lpcrit->SpinCount);
|
|
||||||
|
|
||||||
//ok(lpcrit->DebugInfo != NULL, "no DebugInfo\n");
|
|
||||||
if (lpcrit->DebugInfo)
|
|
||||||
{
|
|
||||||
ok(lpcrit->DebugInfo->Type != 0, "DebugInfo->Type=%d\n", lpcrit->DebugInfo->Type);
|
|
||||||
ok(lpcrit->DebugInfo->CreatorBackTraceIndex != 0, "DebugInfo->CreatorBackTraceIndex=%d\n", lpcrit->DebugInfo->CreatorBackTraceIndex);
|
|
||||||
//ok(lpcrit->DebugInfo->EntryCount != 0, "DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount);
|
|
||||||
//ok(lpcrit->DebugInfo->ContentionCount != 0, "DebugInfo->ContentionCount=%ld\n", lpcrit->DebugInfo->ContentionCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
START_TEST(EngDeleteSemaphore)
|
|
||||||
{
|
|
||||||
Test_EngDeleteSemaphore();
|
|
||||||
}
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ extern void func_CreateRectRgn(void);
|
||||||
extern void func_DPtoLP(void);
|
extern void func_DPtoLP(void);
|
||||||
extern void func_EngAcquireSemaphore(void);
|
extern void func_EngAcquireSemaphore(void);
|
||||||
extern void func_EngCreateSemaphore(void);
|
extern void func_EngCreateSemaphore(void);
|
||||||
extern void func_EngDeleteSemaphore(void);
|
|
||||||
extern void func_EngReleaseSemaphore(void);
|
extern void func_EngReleaseSemaphore(void);
|
||||||
extern void func_EnumFontFamilies(void);
|
extern void func_EnumFontFamilies(void);
|
||||||
extern void func_ExcludeClipRect(void);
|
extern void func_ExcludeClipRect(void);
|
||||||
|
@ -96,7 +95,6 @@ const struct test winetest_testlist[] =
|
||||||
{ "DPtoLP", func_DPtoLP },
|
{ "DPtoLP", func_DPtoLP },
|
||||||
{ "EngAcquireSemaphore", func_EngAcquireSemaphore },
|
{ "EngAcquireSemaphore", func_EngAcquireSemaphore },
|
||||||
{ "EngCreateSemaphore", func_EngCreateSemaphore },
|
{ "EngCreateSemaphore", func_EngCreateSemaphore },
|
||||||
{ "EngDeleteSemaphore", func_EngDeleteSemaphore },
|
|
||||||
{ "EngReleaseSemaphore", func_EngReleaseSemaphore },
|
{ "EngReleaseSemaphore", func_EngReleaseSemaphore },
|
||||||
{ "EnumFontFamilies", func_EnumFontFamilies },
|
{ "EnumFontFamilies", func_EnumFontFamilies },
|
||||||
{ "ExcludeClipRect", func_ExcludeClipRect },
|
{ "ExcludeClipRect", func_ExcludeClipRect },
|
||||||
|
|
Loading…
Reference in a new issue