ReactOS 0.4.16-dev-91-g764881a
EngReleaseSemaphore.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for EngReleaseSemaphore
5 * PROGRAMMERS: Magnus Olsen
6 */
7
8#include "precomp.h"
9
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
22
23 ok(lpcrit->LockCount != 0, "lpcrit->LockCount=%ld\n", lpcrit->LockCount);
24 ok(lpcrit->RecursionCount == 0, "lpcrit->RecursionCount=%ld\n", lpcrit->RecursionCount);
25 ok(lpcrit->OwningThread == 0, "lpcrit->OwningThread=%p\n", lpcrit->OwningThread);
26 ok(lpcrit->LockSemaphore == 0, "lpcrit->LockSemaphore=%p\n", lpcrit->LockSemaphore);
27 ok(lpcrit->SpinCount == 0, "lpcrit->SpinCount=%ld\n", lpcrit->SpinCount);
28
29 ok(lpcrit->DebugInfo != NULL, "no DebugInfo\n");
30 if (lpcrit->DebugInfo)
31 {
32 ok(lpcrit->DebugInfo->Type == 0, "DebugInfo->Type=%d\n", lpcrit->DebugInfo->Type);
33 ok(lpcrit->DebugInfo->CreatorBackTraceIndex == 0, "DebugInfo->CreatorBackTraceIndex=%d\n", lpcrit->DebugInfo->CreatorBackTraceIndex);
34 ok(lpcrit->DebugInfo->EntryCount == 0, "DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount);
35 ok(lpcrit->DebugInfo->ContentionCount == 0, "DebugInfo->ContentionCount=%ld\n", lpcrit->DebugInfo->ContentionCount);
36 }
37
39}
40
42{
44}
45
void Test_EngReleaseSemaphore()
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
DWORD_PTR HSEMAPHORE
Definition: axcore.idl:60
#define NULL
Definition: types.h:112
VOID WINAPI EngReleaseSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:235
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
ENGAPI VOID APIENTRY EngAcquireSemaphore(_Inout_ HSEMAPHORE hsem)