2008-06-01 14:38:02 +00:00
|
|
|
/* Simple test of EngAcquireSemaphore only check if we got a lock or not */
|
|
|
|
INT
|
|
|
|
Test_EngCreateSemaphore(PTESTINFO pti)
|
|
|
|
{
|
|
|
|
|
|
|
|
HSEMAPHORE hsem;
|
2008-06-01 15:06:40 +00:00
|
|
|
PRTL_CRITICAL_SECTION lpcrit;
|
2008-06-01 14:38:02 +00:00
|
|
|
|
2008-06-01 15:06:40 +00:00
|
|
|
hsem = EngCreateSemaphore();
|
2008-06-01 14:38:02 +00:00
|
|
|
RTEST ( hsem != NULL );
|
2008-06-01 15:06:40 +00:00
|
|
|
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);
|
2008-06-01 14:38:02 +00:00
|
|
|
|
2008-06-01 15:48:51 +00:00
|
|
|
ASSERT(lpcrit->DebugInfo != NULL);
|
|
|
|
RTEST (lpcrit->DebugInfo->Type == 0);
|
|
|
|
RTEST (lpcrit->DebugInfo->CreatorBackTraceIndex == 0);
|
|
|
|
RTEST (lpcrit->DebugInfo->EntryCount == 0);
|
|
|
|
RTEST (lpcrit->DebugInfo->ContentionCount == 0);
|
|
|
|
|
2008-06-01 14:38:02 +00:00
|
|
|
EngDeleteSemaphore(hsem);
|
|
|
|
|
|
|
|
return APISTATUS_NORMAL;
|
|
|
|
}
|
|
|
|
|