[GDI32_APITEST] Remove broken EngDeleteSemaphore.c (#655)
authorSerge Gautherie <32623169+SergeGautherie@users.noreply.github.com>
Sun, 19 Aug 2018 20:33:56 +0000 (22:33 +0200)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 19 Aug 2018 20:33:56 +0000 (22:33 +0200)
- 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
modules/rostests/apitests/gdi32/EngDeleteSemaphore.c [deleted file]
modules/rostests/apitests/gdi32/testlist.c

index 4290fce..42453d1 100644 (file)
@@ -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 (file)
index d8c1218..0000000
+++ /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();
-}
-
index c466cde..2c9e70a 100644 (file)
@@ -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 },