Suppress warning of obsolete API (#21529)
authorAaron Robinson <arobins@microsoft.com>
Thu, 13 Dec 2018 22:36:24 +0000 (14:36 -0800)
committerGitHub <noreply@github.com>
Thu, 13 Dec 2018 22:36:24 +0000 (14:36 -0800)
tests/src/JIT/Methodical/structs/ExplicitLayout.cs
tests/src/Loader/classloader/explicitlayout/Regressions/298006/explicitStruct_oddSize.cs
tests/src/baseservices/exceptions/regressions/v4.0/706099/ManagedCom.csproj [deleted file]
tests/src/baseservices/exceptions/regressions/v4.0/706099/managedcom.cs [deleted file]
tests/src/baseservices/threading/commitstackonlyasneeded/StackCommitCommon.cs

index c1aa79c..c6b94f5 100644 (file)
@@ -9,6 +9,7 @@ using System.Runtime.InteropServices;
 
 class ExplicitLayout
 {
+#pragma warning disable 618
     [StructLayout(LayoutKind.Explicit, Size = SIZE)]
     internal unsafe struct TestStruct
     {
@@ -23,6 +24,7 @@ class ExplicitLayout
         [FieldOffset(16), MarshalAs(UnmanagedType.Struct, SizeConst = 16)]
         public Guid Guid2;
     }
+#pragma warning restore 618
 
     internal class Program
     {
index de4eca1..7af2e0e 100644 (file)
@@ -2,7 +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.
 
-// This test is a regression test for VSWhidbey 298006
 // The struct has an objref and is of odd size.
 // The GC requires that all valuetypes containing objrefs be sized to a multiple of sizeof(void*) )== 4).
 // Since the size of this struct was 17 we were throwing a TypeLoadException.
@@ -10,6 +9,7 @@
 using System;
 using System.Runtime.InteropServices;
 
+#pragma warning disable 618
 [StructLayout(LayoutKind.Explicit)]
 public struct S
 {
@@ -17,36 +17,35 @@ public struct S
     [FieldOffset(8)] public double d;
     [FieldOffset(0), MarshalAs(UnmanagedType.BStr)] public string st;
 }
-
-
+#pragma warning restore 618
 
 public class Test
 {
-        public static void Run()
-       {
-               S s;
-               s.b = true;
-       }
-        
-       public static int Main()
-       {
-               try
-               {
-                       Run();
-
-                       Console.WriteLine("PASS");
-                       return 100;
-               }
-               catch (TypeLoadException e)
-               {
-                       Console.WriteLine("FAIL: Caught unexpected TypeLoadException: {0}", e.Message);
-                       return 101;
-               }
-               catch (Exception e)
-               {
-                       Console.WriteLine("FAIL: Caught unexpected Exception: {0}", e.Message);
-                       return 101;
-               }
-       }
+    public static void Run()
+    {
+        S s;
+        s.b = true;
+    }
+
+    public static int Main()
+    {
+        try
+        {
+            Run();
+
+            Console.WriteLine("PASS");
+            return 100;
+        }
+        catch (TypeLoadException e)
+        {
+            Console.WriteLine("FAIL: Caught unexpected TypeLoadException: {0}", e.Message);
+            return 101;
+        }
+        catch (Exception e)
+        {
+            Console.WriteLine("FAIL: Caught unexpected Exception: {0}", e.Message);
+            return 101;
+        }
+    }
 
  }
diff --git a/tests/src/baseservices/exceptions/regressions/v4.0/706099/ManagedCom.csproj b/tests/src/baseservices/exceptions/regressions/v4.0/706099/ManagedCom.csproj
deleted file mode 100644 (file)
index 79d4516..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <CLRTestKind>SharedLibrary</CLRTestKind>
-    <CLRTestPriority>1</CLRTestPriority>
-  </PropertyGroup>
-  <!-- Default configurations to help VS understand the configurations -->
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-  </PropertyGroup>
-  <ItemGroup>
-    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
-      <Visible>False</Visible>
-    </CodeAnalysisDependentAssemblyPaths>
-  </ItemGroup>
-  <ItemGroup>
-    <!-- Add Compile Object Here -->
-    <Compile Include="managedcom.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="../../../../../Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj" />
-  </ItemGroup>
-  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
-  </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/tests/src/baseservices/exceptions/regressions/v4.0/706099/managedcom.cs b/tests/src/baseservices/exceptions/regressions/v4.0/706099/managedcom.cs
deleted file mode 100644 (file)
index 5eefd5d..0000000
+++ /dev/null
@@ -1,62 +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 System;
-using System.Runtime.InteropServices;
-
-[ComVisible(true)]
-[ClassInterface(ClassInterfaceType.AutoDual)]
-[Guid("2A9F41BC-94F4-4889-9F8A-E0290CEF1177")]
-public class Class1COMInterop
-{
-    public delegate void Callback();
-
-    [DllImport("NativePinvoke", CallingConvention=CallingConvention.StdCall)]
-    public static extern void Native2(Callback call);
-
-    [DispId(1)]
-    public void Managed1() 
-    {
-        Console.WriteLine("Inside Managed1");
-        try
-        {
-            Managed2();
-        }
-        finally
-        {            
-               try
-               {
-                   throw new ArgumentException();
-               }
-               catch(ArgumentException e)
-               {
-                   Console.WriteLine("Managed1: Caught Exception: " + e);
-               }
-        }
-    }
-
-    public static void Managed2()
-    {
-        Console.WriteLine("Inside Managed2");
-
-        // pinvoke into Native2
-        Native2( new Callback(Managed3) );
-
-    }
-
-    public static void Managed3()
-    {
-        Console.WriteLine("Inside Managed3()");
-        Managed4();
-    }
-
-    public static void Managed4()
-    {
-
-        Console.WriteLine("Inside Managed4()");
-
-        // Throw IndexOutOfBounds
-        int[] IntArray = new int[10];
-        IntArray[11] = 5;
-    }
-}
\ No newline at end of file
index d97f9c2..1b814b7 100644 (file)
@@ -7,14 +7,15 @@ using System.Linq;
 using System.Text;
 using System.Runtime.InteropServices;
 using System.Threading;
-//using System.Configuration;
 
 namespace StackCommitTest
 {
     public unsafe class WinApi
     {
+#pragma warning disable 618
         [DllImport("kernel32.dll")]
         public static extern void GetSystemInfo([MarshalAs(UnmanagedType.Struct)] ref SYSTEM_INFO lpSystemInfo);
+#pragma warning restore 618
 
         [StructLayout(LayoutKind.Sequential)]
         public struct SYSTEM_INFO