2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for EngReleaseSemaphore
5 * PROGRAMMERS: Magnus Olsen
13 void Test_EngReleaseSemaphore()
16 PRTL_CRITICAL_SECTION lpcrit
;
18 hsem
= EngCreateSemaphore();
19 ok(hsem
!= NULL
, "EngCreateSemaphore failed\n");
21 lpcrit
= (PRTL_CRITICAL_SECTION
)hsem
;
23 EngAcquireSemaphore(hsem
);
24 EngReleaseSemaphore(hsem
);
26 ok(lpcrit
->LockCount
!= 0, "lpcrit->LockCount=%ld\n", lpcrit
->LockCount
);
27 ok(lpcrit
->RecursionCount
== 0, "lpcrit->RecursionCount=%ld\n", lpcrit
->RecursionCount
);
28 ok(lpcrit
->OwningThread
== 0, "lpcrit->OwningThread=%p\n", lpcrit
->OwningThread
);
29 ok(lpcrit
->LockSemaphore
== 0, "lpcrit->LockSemaphore=%p\n", lpcrit
->LockSemaphore
);
30 ok(lpcrit
->SpinCount
== 0, "lpcrit->SpinCount=%ld\n", lpcrit
->SpinCount
);
32 ok(lpcrit
->DebugInfo
!= NULL
, "no DebugInfo\n");
33 if (lpcrit
->DebugInfo
)
35 ok(lpcrit
->DebugInfo
->Type
== 0, "DebugInfo->Type=%d\n", lpcrit
->DebugInfo
->Type
);
36 ok(lpcrit
->DebugInfo
->CreatorBackTraceIndex
== 0, "DebugInfo->CreatorBackTraceIndex=%d\n", lpcrit
->DebugInfo
->CreatorBackTraceIndex
);
37 ok(lpcrit
->DebugInfo
->EntryCount
== 0, "DebugInfo->EntryCount=%ld\n", lpcrit
->DebugInfo
->EntryCount
);
38 ok(lpcrit
->DebugInfo
->ContentionCount
== 0, "DebugInfo->ContentionCount=%ld\n", lpcrit
->DebugInfo
->ContentionCount
);
41 EngDeleteSemaphore(hsem
);
44 START_TEST(EngReleaseSemaphore
)
46 Test_EngReleaseSemaphore();