add more test for EngCreateSemaphore, it checking some info in the internal HANDLE...
[reactos.git] / rostests / apitests / gdi32api / tests / EngCreateSemaphore.c
1 /* Simple test of EngAcquireSemaphore only check if we got a lock or not */
2 INT
3 Test_EngCreateSemaphore(PTESTINFO pti)
4 {
5
6 HSEMAPHORE hsem;
7 PRTL_CRITICAL_SECTION lpcrit;
8
9 hsem = EngCreateSemaphore();
10 RTEST ( hsem != NULL );
11 ASSERT(hsem != NULL);
12
13 lpcrit = (PRTL_CRITICAL_SECTION) hsem;
14 RTEST ( lpcrit->DebugInfo != NULL);
15 RTEST (lpcrit->LockCount == -1);
16 RTEST (lpcrit->RecursionCount == 0);
17 RTEST (lpcrit->OwningThread == 0);
18 RTEST (lpcrit->LockSemaphore == 0);
19 RTEST (lpcrit->SpinCount == 0);
20
21 EngDeleteSemaphore(hsem);
22
23 return APISTATUS_NORMAL;
24 }
25