Delete CoreFX tests of COM lifetime control methods. (dotnet/corefx#38290)
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Fri, 7 Jun 2019 02:58:08 +0000 (19:58 -0700)
committerStephen Toub <stoub@microsoft.com>
Fri, 7 Jun 2019 02:58:07 +0000 (22:58 -0400)
* Delete CoreFX tests of COM lifetime control methods.

* Remove deleted files from project file.

Commit migrated from https://github.com/dotnet/corefx/commit/500e6882a78c92ecfd584bd4d8ba8e49f4410eb7

src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.Tests.csproj
src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AreComObjectsAvailableForCleanupTests.cs [deleted file]
src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/CleanupUnusedObjectsInCurrentContextTests.cs [deleted file]
src/libraries/System.Threading.Thread/tests/ThreadTests.cs

index 5f134d8..52c8edd 100644 (file)
     <Compile Include="System\Runtime\InteropServices\Marshal\Copy\SingleArrayTests.cs" />
     <Compile Include="System\Runtime\InteropServices\Marshal\AddRefTests.cs" />
     <Compile Include="System\Runtime\InteropServices\Marshal\AllocHGlobalTests.cs" />
-    <Compile Include="System\Runtime\InteropServices\Marshal\AreComObjectsAvailableForCleanupTests.cs" />
     <Compile Include="System\Runtime\InteropServices\Marshal\BindToMonikerTests.cs" />
     <Compile Include="System\Runtime\InteropServices\Marshal\ChangeWrapperHandleStrengthTests.cs" />
     <Compile Include="System\Runtime\InteropServices\Marshal\ChangeWrapperHandleStrengthTests.Windows.cs" Condition="'$(TargetsWindows)' == 'true'" />
-    <Compile Include="System\Runtime\InteropServices\Marshal\CleanupUnusedObjectsInCurrentContextTests.cs" />
     <Compile Include="System\Runtime\InteropServices\Marshal\CreateAggregatedObjectTests.cs" />
     <Compile Include="System\Runtime\InteropServices\Marshal\CreateWrapperOfTypeTests.cs" />
     <Compile Include="System\Runtime\InteropServices\Marshal\CreateWrapperOfTypeTests.Windows.cs" Condition="'$(TargetsWindows)' == 'true'" />
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 (file)
index f4db8c0..0000000
+++ /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 (file)
index c572e24..0000000
+++ /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());
-        }
-    }
-}
index 8c35d1c..6e35f06 100644 (file)
@@ -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<InvalidOperationException>(() => Thread.CurrentThread.GetCompressedStack());
             Assert.Throws<InvalidOperationException>(() => Thread.CurrentThread.SetCompressedStack(CompressedStack.Capture()));