From a01d6d345f03d37dcd21ba6d18fc32b6d8acb2a6 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 6 Jun 2019 19:58:08 -0700 Subject: [PATCH] Delete CoreFX tests of COM lifetime control methods. (dotnet/corefx#38290) * Delete CoreFX tests of COM lifetime control methods. * Remove deleted files from project file. Commit migrated from https://github.com/dotnet/corefx/commit/500e6882a78c92ecfd584bd4d8ba8e49f4410eb7 --- .../System.Runtime.InteropServices.Tests.csproj | 2 -- .../AreComObjectsAvailableForCleanupTests.cs | 17 ---------------- .../CleanupUnusedObjectsInCurrentContextTests.cs | 23 ---------------------- .../System.Threading.Thread/tests/ThreadTests.cs | 7 ------- 4 files changed, 49 deletions(-) delete mode 100644 src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AreComObjectsAvailableForCleanupTests.cs delete mode 100644 src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/CleanupUnusedObjectsInCurrentContextTests.cs diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.Tests.csproj index 5f134d8..52c8edd 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.Tests.csproj @@ -54,11 +54,9 @@ - - diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AreComObjectsAvailableForCleanupTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AreComObjectsAvailableForCleanupTests.cs deleted file mode 100644 index f4db8c0..0000000 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AreComObjectsAvailableForCleanupTests.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Xunit; - -namespace System.Runtime.InteropServices.Tests -{ - public class AreComObjectsAvailableForCleanupTests - { - [Fact] - public void AreComObjectsAvailableForCleanup_NothingToCleanup_ReturnsFalse() - { - Assert.False(Marshal.AreComObjectsAvailableForCleanup()); - } - } -} diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/CleanupUnusedObjectsInCurrentContextTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/CleanupUnusedObjectsInCurrentContextTests.cs deleted file mode 100644 index c572e24..0000000 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/CleanupUnusedObjectsInCurrentContextTests.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Xunit; - -namespace System.Runtime.InteropServices.Tests -{ - public class CleanupUnusedObjectsInCurrentContextTests - { - [Fact] - public void CleanupUnusedObjectsInCurrentContext_InvokeSeveralTimes_Success() - { - Marshal.CleanupUnusedObjectsInCurrentContext(); - Assert.False(Marshal.AreComObjectsAvailableForCleanup()); - - // Invoke twice to make sure things work when unused objects have already been - // cleaned up and there is nothing to do. - Marshal.CleanupUnusedObjectsInCurrentContext(); - Assert.False(Marshal.AreComObjectsAvailableForCleanup()); - } - } -} diff --git a/src/libraries/System.Threading.Thread/tests/ThreadTests.cs b/src/libraries/System.Threading.Thread/tests/ThreadTests.cs index 8c35d1c..6e35f06 100644 --- a/src/libraries/System.Threading.Thread/tests/ThreadTests.cs +++ b/src/libraries/System.Threading.Thread/tests/ThreadTests.cs @@ -1090,13 +1090,6 @@ namespace System.Threading.Threads.Tests Thread.BeginThreadAffinity(); Thread.EndThreadAffinity(); - ThreadTestHelpers.RunTestInBackgroundThread(() => - { - // TODO: Port tests for these once all of the necessary interop APIs are available - Thread.CurrentThread.DisableComObjectEagerCleanup(); - Marshal.CleanupUnusedObjectsInCurrentContext(); - }); - #pragma warning disable 618 // obsolete members Assert.Throws(() => Thread.CurrentThread.GetCompressedStack()); Assert.Throws(() => Thread.CurrentThread.SetCompressedStack(CompressedStack.Capture())); -- 2.7.4