Remove the Obsolete attribute from the various types that support COM events. (#35412)
authorAaron Robinson <arobins@microsoft.com>
Sat, 25 Apr 2020 00:24:42 +0000 (17:24 -0700)
committerGitHub <noreply@github.com>
Sat, 25 Apr 2020 00:24:42 +0000 (17:24 -0700)
Update tests to remove the suppression.

src/coreclr/tests/src/Interop/COM/NETClients/Events/Program.cs
src/coreclr/tests/src/Interop/COM/NETServer/EventTesting.cs
src/coreclr/tests/src/Interop/COM/ServerContracts/Server.Events.cs
src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs
src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/ComAwareEventInfoTests.Windows.cs
src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/ComAwareEventInfoTests.cs
src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/ComEventInterfaceAttributeTests.cs
src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/ComEventsHelperTests.cs
src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/ComSourceInterfacesAttributeTests.cs

index 4935924..c6cc282 100644 (file)
@@ -50,8 +50,6 @@ namespace NetClient
             }
         }
 
-#pragma warning disable 618 // Must test deprecated features
-
         // The ComAwareEventInfo is used by the compiler when PIAs
         // containing COM Events are embedded.
         static void Validate_COMEventViaComAwareEventInfo()
@@ -90,8 +88,6 @@ namespace NetClient
             }
         }
 
-#pragma warning restore 618 // Must test deprecated features
-
         static int Main(string[] doNotUse)
         {
             // RegFree COM is not supported on Windows Nano
index ba909eb..63757fa 100644 (file)
@@ -8,8 +8,6 @@ using System.Text;
 using System.Runtime.InteropServices;
 using Server.Contract;
 
-#pragma warning disable 618 // Must test deprecated features
-
 [ComVisible(true)]
 [Guid(Server.Contract.Guids.EventTesting)]
 [ComSourceInterfaces(typeof(Server.Contract.TestingEvents))]
index 16ed578..37d598f 100644 (file)
@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-#pragma warning disable 618 // Must test deprecated features
-
 namespace Server.Contract
 {
     using System;
@@ -189,5 +187,3 @@ namespace Server.Contract
         }
     }
 }
-
-#pragma warning restore 618 // Must test deprecated features
index b077424..caa1aab 100644 (file)
@@ -172,7 +172,6 @@ namespace System.Runtime.InteropServices
         public string Value { get { throw null; } }
     }
     [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
-    [System.ObsoleteAttribute("ComAwareEventInfo may be unavailable in future releases.")]
     public partial class ComAwareEventInfo : System.Reflection.EventInfo
     {
         public ComAwareEventInfo(System.Type type, string eventName) { }
@@ -219,7 +218,6 @@ namespace System.Runtime.InteropServices
     }
     [System.AttributeUsageAttribute(System.AttributeTargets.Interface, Inherited=false)]
     [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
-    [System.ObsoleteAttribute("ComEventInterfaceAttribute may be unavailable in future releases.")]
     public sealed partial class ComEventInterfaceAttribute : System.Attribute
     {
         public ComEventInterfaceAttribute(System.Type SourceInterface, System.Type EventProvider) { }
@@ -227,7 +225,6 @@ namespace System.Runtime.InteropServices
         public System.Type SourceInterface { get { throw null; } }
     }
     [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
-    [System.ObsoleteAttribute("ComEventsHelper may be unavailable in future releases.")]
     public static partial class ComEventsHelper
     {
         public static void Combine(object rcw, System.Guid iid, int dispid, System.Delegate d) { }
@@ -271,7 +268,6 @@ namespace System.Runtime.InteropServices
     }
     [System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=true)]
     [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
-    [System.ObsoleteAttribute("ComSourceInterfacesAttribute may be unavailable in future releases.")]
     public sealed partial class ComSourceInterfacesAttribute : System.Attribute
     {
         public ComSourceInterfacesAttribute(string sourceInterfaces) { }
index fc73fe7..a9317f8 100644 (file)
@@ -9,7 +9,6 @@ using Xunit;
 
 namespace System.Runtime.InteropServices.Tests
 {
-#pragma warning disable 0618 // CompareEventInfo is marked as Obsolete.
     public partial class ComAwareEventInfoTests
     {
         [ComEventInterface(typeof(DispAttributeClass), typeof(int))]
@@ -126,5 +125,4 @@ namespace System.Runtime.InteropServices.Tests
             public void Event() { }
         }
     }
-#pragma warning restore 0618
 }
index 49d915e..f3513d4 100644 (file)
@@ -8,7 +8,6 @@ using Xunit;
 
 namespace System.Runtime.InteropServices.Tests
 {
-#pragma warning disable 0618 // CompareEventInfo is marked as Obsolete.
     public partial class ComAwareEventInfoTests
     {
         [Fact]
@@ -109,5 +108,4 @@ namespace System.Runtime.InteropServices.Tests
             public void Raise(object sender) => Event.Invoke(1, null);
         }
     }
-#pragma warning restore 0618
 }
index 0926a48..489cfbd 100644 (file)
@@ -6,7 +6,6 @@ using Xunit;
 
 namespace System.Runtime.InteropServices.Tests
 {
-#pragma warning disable 0618 // ComEventInterfaceAttribute is marked as Obsolete.
     public class ComEventInterfaceAttributeTests
     {
         [Theory]
@@ -19,5 +18,4 @@ namespace System.Runtime.InteropServices.Tests
             Assert.Equal(eventProvider, attribute.EventProvider);
         }
     }
-#pragma warning restore 0618
 }
index d4877ac..9cfbe34 100644 (file)
@@ -6,7 +6,6 @@ using Xunit;
 
 namespace System.Runtime.InteropServices.Tests
 {
-#pragma warning disable 0618 // ComEventsHelper is marked as Obsolete.
     public class ComEventsHelperTests
     {
         [Fact]
@@ -51,5 +50,4 @@ namespace System.Runtime.InteropServices.Tests
             AssertExtensions.Throws<ArgumentException>("obj", () => ComEventsHelper.Remove(1, Guid.Empty, 1, null));
         }
     }
-#pragma warning restore 0618
 }
index b51de24..ab86f6a 100644 (file)
@@ -6,7 +6,6 @@ using Xunit;
 
 namespace System.Runtime.InteropServices.Tests
 {
-#pragma warning disable 0618 // ComSourceInterfacesAttribute is marked as Obsolete.
     public class ComSourceInterfacesAttributeTests
     {
         [Theory]
@@ -76,5 +75,4 @@ namespace System.Runtime.InteropServices.Tests
             Assert.Throws<NullReferenceException>(() => new ComSourceInterfacesAttribute(typeof(int), typeof(string), typeof(bool), null));
         }
     }
-#pragma warning restore 0618
 }