ReactOS 0.4.15-dev-7953-g1f49173
EngCreateSemaphore.c File Reference
#include "precomp.h"
Include dependency graph for EngCreateSemaphore.c:

Go to the source code of this file.

Functions

void Test_EngCreateSemaphore ()
 
 START_TEST (EngCreateSemaphore)
 

Function Documentation

◆ START_TEST()

START_TEST ( EngCreateSemaphore  )

Definition at line 38 of file EngCreateSemaphore.c.

39{
41}
void Test_EngCreateSemaphore()

◆ Test_EngCreateSemaphore()

void Test_EngCreateSemaphore ( )

Definition at line 10 of file EngCreateSemaphore.c.

11{
12 HSEMAPHORE hsem;
14
15 hsem = EngCreateSemaphore();
16 ok(hsem != NULL, "EngCreateSemaphore failed\n");
17 if (!hsem) return;
18 lpcrit = (PRTL_CRITICAL_SECTION)hsem;
19
20 ok(lpcrit->LockCount == -1, "lpcrit->LockCount=%ld\n", lpcrit->LockCount);
21 ok(lpcrit->RecursionCount == 0, "lpcrit->RecursionCount=%ld\n", lpcrit->RecursionCount);
22 ok(lpcrit->OwningThread == 0, "lpcrit->OwningThread=%p\n", lpcrit->OwningThread);
23 ok(lpcrit->LockSemaphore == 0, "lpcrit->LockSemaphore=%p\n", lpcrit->LockSemaphore);
24 ok(lpcrit->SpinCount == 0, "lpcrit->SpinCount=%ld\n", lpcrit->SpinCount);
25
26 ok(lpcrit->DebugInfo != NULL, "no DebugInfo\n");
27 if (lpcrit->DebugInfo)
28 {
29 ok(lpcrit->DebugInfo->Type == 0, "DebugInfo->Type=%d\n", lpcrit->DebugInfo->Type);
30 ok(lpcrit->DebugInfo->CreatorBackTraceIndex == 0, "DebugInfo->CreatorBackTraceIndex=%d\n", lpcrit->DebugInfo->CreatorBackTraceIndex);
31 ok(lpcrit->DebugInfo->EntryCount == 0, "DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount);
32 ok(lpcrit->DebugInfo->ContentionCount == 0, "DebugInfo->ContentionCount=%ld\n", lpcrit->DebugInfo->ContentionCount);
33 }
34
36}
#define ok(value,...)
Definition: atltest.h:57
DWORD_PTR HSEMAPHORE
Definition: axcore.idl:60
#define NULL
Definition: types.h:112
HSEMAPHORE WINAPI EngCreateSemaphore(VOID)
Definition: eng.c:75
struct _RTL_CRITICAL_SECTION * PRTL_CRITICAL_SECTION
PRTL_CRITICAL_SECTION_DEBUG DebugInfo
Definition: rtltypes.h:1431
_Requires_lock_not_held_ hsem ENGAPI VOID APIENTRY EngDeleteSemaphore(_Inout_ __drv_freesMem(Mem) HSEMAPHORE hsem)
Definition: semaphor.c:106

Referenced by START_TEST().