https://git.reactos.org/?p=reactos.git;a=commitdiff;h=155bd681a0eeaf0e63eb53...
commit 155bd681a0eeaf0e63eb53513f5cd3bc80143b2a Author: Serge Gautherie 32623169+SergeGautherie@users.noreply.github.com AuthorDate: Sun Aug 19 22:33:56 2018 +0200 Commit: Timo Kreuzer timo.kreuzer@reactos.org CommitDate: Sun Aug 19 22:33:56 2018 +0200
[GDI32_APITEST] Remove broken EngDeleteSemaphore.c (#655)
- Checks are actually uses-after-free, "by design" :-< - Actual test code duplicates EngCreateSemaphore.c, EngAcquireSemaphore.c and EngReleaseSemaphore.c. --- modules/rostests/apitests/gdi32/CMakeLists.txt | 1 - .../rostests/apitests/gdi32/EngDeleteSemaphore.c | 67 ---------------------- modules/rostests/apitests/gdi32/testlist.c | 2 - 3 files changed, 70 deletions(-)
diff --git a/modules/rostests/apitests/gdi32/CMakeLists.txt b/modules/rostests/apitests/gdi32/CMakeLists.txt index 4290fce8d6..42453d1e98 100644 --- a/modules/rostests/apitests/gdi32/CMakeLists.txt +++ b/modules/rostests/apitests/gdi32/CMakeLists.txt @@ -21,7 +21,6 @@ list(APPEND SOURCE DPtoLP.c EngAcquireSemaphore.c EngCreateSemaphore.c - EngDeleteSemaphore.c EngReleaseSemaphore.c EnumFontFamilies.c ExcludeClipRect.c diff --git a/modules/rostests/apitests/gdi32/EngDeleteSemaphore.c b/modules/rostests/apitests/gdi32/EngDeleteSemaphore.c deleted file mode 100644 index d8c1218e3e..0000000000 --- a/modules/rostests/apitests/gdi32/EngDeleteSemaphore.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * PROJECT: ReactOS api tests - * LICENSE: GPL - See COPYING in the top level directory - * PURPOSE: Test for EngDeleteSemaphore - * PROGRAMMERS: Magnus Olsen - */ - -#include "precomp.h" - -void Test_EngDeleteSemaphore() -{ - HSEMAPHORE hsem; - PRTL_CRITICAL_SECTION lpcrit; - - /* test Create then delete */ - hsem = EngCreateSemaphore(); - ok(hsem != NULL, "EngCreateSemaphore failed\n"); - if (!hsem) return; - lpcrit = (PRTL_CRITICAL_SECTION)hsem; - EngDeleteSemaphore(hsem); - -// ok(lpcrit->LockCount > 0); doesn't work on XP - ok(lpcrit->RecursionCount == 0, "lpcrit->RecursionCount=%ld\n", lpcrit->RecursionCount); - ok(lpcrit->OwningThread == 0, "lpcrit->OwningThread=%p\n", lpcrit->OwningThread); - ok(lpcrit->LockSemaphore == 0, "lpcrit->LockSemaphore=%p\n", lpcrit->LockSemaphore); - ok(lpcrit->SpinCount == 0, "lpcrit->SpinCount=%ld\n", lpcrit->SpinCount); - - //ok(lpcrit->DebugInfo != NULL, "no DebugInfo\n"); - if (lpcrit->DebugInfo) - { - ok(lpcrit->DebugInfo->Type != 0, "DebugInfo->Type=%d\n", lpcrit->DebugInfo->Type); - ok(lpcrit->DebugInfo->CreatorBackTraceIndex != 0, "DebugInfo->CreatorBackTraceIndex=%d\n", lpcrit->DebugInfo->CreatorBackTraceIndex); - //ok(lpcrit->DebugInfo->EntryCount != 0, "DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount); - //ok(lpcrit->DebugInfo->ContentionCount != 0, "DebugInfo->ContentionCount=%ld\n", lpcrit->DebugInfo->ContentionCount); - } - - /* test EngAcquireSemaphore and release it, then delete it */ - hsem = EngCreateSemaphore(); - ok(hsem != NULL, "EngCreateSemaphore failed\n"); - if (!hsem) return; - lpcrit = (PRTL_CRITICAL_SECTION)hsem; - - EngAcquireSemaphore(hsem); - EngReleaseSemaphore(hsem); - EngDeleteSemaphore(hsem); - - //ok(lpcrit->LockCount > 0, "lpcrit->LockCount=%ld\n", lpcrit->LockCount); - ok(lpcrit->RecursionCount == 0, "lpcrit->RecursionCount=%ld\n", lpcrit->RecursionCount); - ok(lpcrit->OwningThread == 0, "lpcrit->OwningThread=%p\n", lpcrit->OwningThread); - ok(lpcrit->LockSemaphore == 0, "lpcrit->LockSemaphore=%p\n", lpcrit->LockSemaphore); - ok(lpcrit->SpinCount == 0, "lpcrit->SpinCount=%ld\n", lpcrit->SpinCount); - - //ok(lpcrit->DebugInfo != NULL, "no DebugInfo\n"); - if (lpcrit->DebugInfo) - { - ok(lpcrit->DebugInfo->Type != 0, "DebugInfo->Type=%d\n", lpcrit->DebugInfo->Type); - ok(lpcrit->DebugInfo->CreatorBackTraceIndex != 0, "DebugInfo->CreatorBackTraceIndex=%d\n", lpcrit->DebugInfo->CreatorBackTraceIndex); - //ok(lpcrit->DebugInfo->EntryCount != 0, "DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount); - //ok(lpcrit->DebugInfo->ContentionCount != 0, "DebugInfo->ContentionCount=%ld\n", lpcrit->DebugInfo->ContentionCount); - } -} - -START_TEST(EngDeleteSemaphore) -{ - Test_EngDeleteSemaphore(); -} - diff --git a/modules/rostests/apitests/gdi32/testlist.c b/modules/rostests/apitests/gdi32/testlist.c index c466cde5bd..2c9e70af4a 100644 --- a/modules/rostests/apitests/gdi32/testlist.c +++ b/modules/rostests/apitests/gdi32/testlist.c @@ -22,7 +22,6 @@ extern void func_CreateRectRgn(void); extern void func_DPtoLP(void); extern void func_EngAcquireSemaphore(void); extern void func_EngCreateSemaphore(void); -extern void func_EngDeleteSemaphore(void); extern void func_EngReleaseSemaphore(void); extern void func_EnumFontFamilies(void); extern void func_ExcludeClipRect(void); @@ -96,7 +95,6 @@ const struct test winetest_testlist[] = { "DPtoLP", func_DPtoLP }, { "EngAcquireSemaphore", func_EngAcquireSemaphore }, { "EngCreateSemaphore", func_EngCreateSemaphore }, - { "EngDeleteSemaphore", func_EngDeleteSemaphore }, { "EngReleaseSemaphore", func_EngReleaseSemaphore }, { "EnumFontFamilies", func_EnumFontFamilies }, { "ExcludeClipRect", func_ExcludeClipRect },