1c2c66affSColin Finck /*
2c2c66affSColin Finck  * PROJECT:         ReactOS api tests
3c2c66affSColin Finck  * LICENSE:         GPL - See COPYING in the top level directory
4c2c66affSColin Finck  * PURPOSE:         Test for EngReleaseSemaphore
5c2c66affSColin Finck  * PROGRAMMERS:     Magnus Olsen
6c2c66affSColin Finck  */
7c2c66affSColin Finck 
8*aee83c35SAmine Khaldi #include "precomp.h"
9c2c66affSColin Finck 
Test_EngReleaseSemaphore()10c2c66affSColin Finck void Test_EngReleaseSemaphore()
11c2c66affSColin Finck {
12c2c66affSColin Finck     HSEMAPHORE hsem;
13c2c66affSColin Finck     PRTL_CRITICAL_SECTION lpcrit;
14c2c66affSColin Finck 
15c2c66affSColin Finck     hsem = EngCreateSemaphore();
16c2c66affSColin Finck     ok(hsem != NULL, "EngCreateSemaphore failed\n");
17c2c66affSColin Finck     if (!hsem) return;
18c2c66affSColin Finck     lpcrit = (PRTL_CRITICAL_SECTION)hsem;
19c2c66affSColin Finck 
20c2c66affSColin Finck     EngAcquireSemaphore(hsem);
21c2c66affSColin Finck     EngReleaseSemaphore(hsem);
22c2c66affSColin Finck 
23c2c66affSColin Finck     ok(lpcrit->LockCount != 0, "lpcrit->LockCount=%ld\n", lpcrit->LockCount);
24c2c66affSColin Finck     ok(lpcrit->RecursionCount == 0, "lpcrit->RecursionCount=%ld\n", lpcrit->RecursionCount);
25c2c66affSColin Finck     ok(lpcrit->OwningThread == 0, "lpcrit->OwningThread=%p\n", lpcrit->OwningThread);
26c2c66affSColin Finck     ok(lpcrit->LockSemaphore == 0, "lpcrit->LockSemaphore=%p\n", lpcrit->LockSemaphore);
27c2c66affSColin Finck     ok(lpcrit->SpinCount == 0, "lpcrit->SpinCount=%ld\n", lpcrit->SpinCount);
28c2c66affSColin Finck 
29c2c66affSColin Finck     ok(lpcrit->DebugInfo != NULL, "no DebugInfo\n");
30c2c66affSColin Finck     if (lpcrit->DebugInfo)
31c2c66affSColin Finck     {
32c2c66affSColin Finck         ok(lpcrit->DebugInfo->Type == 0, "DebugInfo->Type=%d\n", lpcrit->DebugInfo->Type);
33c2c66affSColin Finck         ok(lpcrit->DebugInfo->CreatorBackTraceIndex == 0, "DebugInfo->CreatorBackTraceIndex=%d\n", lpcrit->DebugInfo->CreatorBackTraceIndex);
34c2c66affSColin Finck         ok(lpcrit->DebugInfo->EntryCount == 0, "DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount);
35c2c66affSColin Finck         ok(lpcrit->DebugInfo->ContentionCount == 0, "DebugInfo->ContentionCount=%ld\n", lpcrit->DebugInfo->ContentionCount);
36c2c66affSColin Finck     }
37c2c66affSColin Finck 
38c2c66affSColin Finck     EngDeleteSemaphore(hsem);
39c2c66affSColin Finck }
40c2c66affSColin Finck 
START_TEST(EngReleaseSemaphore)41c2c66affSColin Finck START_TEST(EngReleaseSemaphore)
42c2c66affSColin Finck {
43c2c66affSColin Finck     Test_EngReleaseSemaphore();
44c2c66affSColin Finck }
45c2c66affSColin Finck 
46