1 /* 2 * PROJECT: ReactOS api tests 3 * LICENSE: GPL - See COPYING in the top level directory 4 * PURPOSE: Test for EngCreateSemaphore 5 * PROGRAMMERS: Magnus Olsen 6 */ 7 8 #include "precomp.h" 9 10 void Test_EngCreateSemaphore() 11 { 12 HSEMAPHORE hsem; 13 PRTL_CRITICAL_SECTION lpcrit; 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 35 EngDeleteSemaphore(hsem); 36 } 37 38 START_TEST(EngCreateSemaphore) 39 { 40 Test_EngCreateSemaphore(); 41 } 42 43