mirror of
https://github.com/reactos/reactos.git
synced 2024-09-03 17:19:20 +00:00
![Magnus Olsen](/assets/img/avatar_default.png)
I think it testing all case it can now, and also split up some test to EngDeleteSemaphore and EngReleaseSemaphore and EngAcquireSemaphore, that was in EngCreateSemaphore svn path=/trunk/; revision=33816
32 lines
848 B
C
32 lines
848 B
C
/* Simple test of EngAcquireSemaphore only check if we got a lock or not */
|
|
INT
|
|
Test_EngCreateSemaphore(PTESTINFO pti)
|
|
{
|
|
|
|
HSEMAPHORE hsem;
|
|
PRTL_CRITICAL_SECTION lpcrit;
|
|
|
|
hsem = EngCreateSemaphore();
|
|
RTEST ( hsem != NULL );
|
|
ASSERT(hsem != NULL);
|
|
|
|
lpcrit = (PRTL_CRITICAL_SECTION) hsem;
|
|
RTEST ( lpcrit->DebugInfo != NULL);
|
|
RTEST (lpcrit->LockCount == -1);
|
|
RTEST (lpcrit->RecursionCount == 0);
|
|
RTEST (lpcrit->OwningThread == 0);
|
|
RTEST (lpcrit->LockSemaphore == 0);
|
|
RTEST (lpcrit->SpinCount == 0);
|
|
|
|
ASSERT(lpcrit->DebugInfo != NULL);
|
|
RTEST (lpcrit->DebugInfo->Type == 0);
|
|
RTEST (lpcrit->DebugInfo->CreatorBackTraceIndex == 0);
|
|
RTEST (lpcrit->DebugInfo->EntryCount == 0);
|
|
RTEST (lpcrit->DebugInfo->ContentionCount == 0);
|
|
|
|
EngDeleteSemaphore(hsem);
|
|
|
|
return APISTATUS_NORMAL;
|
|
}
|
|
|