From: Elinor Fung Date: Fri, 30 Jul 2021 13:52:29 +0000 (-0700) Subject: Remove redundant assembly loader tests (#56505) X-Git-Tag: accepted/tizen/unified/20220110.054933~764 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=560b7393e95ebff57d3999375f8f7efaa2b0df12;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Remove redundant assembly loader tests (#56505) --- diff --git a/src/tests/Loader/binding/assemblies/assemblybugs/177066w/repro177066.cs b/src/tests/Loader/binding/assemblies/assemblybugs/177066w/repro177066.cs deleted file mode 100644 index 76dcac0..0000000 --- a/src/tests/Loader/binding/assemblies/assemblybugs/177066w/repro177066.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Reflection; - -public class Repro -{ - - public static int Main() - { - try - { - AssemblyName an = new AssemblyName("system, processorArchitecture=somebadvalue"); - } - catch(System.IO.FileLoadException e) - { - if(e.ToString().ToUpper().IndexOf("UNKNOWN ERROR") == -1) - { - //we didn't get "Unknown error" in the exception text - Console.WriteLine("Pass"); - return 100; - } - else - { - Console.WriteLine("Wrong exception text: " + e.ToString()); - Console.WriteLine("FAIL"); - return 101; - } - } - Console.WriteLine("Didn't catch FileLoadException. FAIL"); - return 99; - } -} - diff --git a/src/tests/Loader/binding/assemblies/assemblybugs/177066w/repro177066.csproj b/src/tests/Loader/binding/assemblies/assemblybugs/177066w/repro177066.csproj deleted file mode 100644 index 68c37a2..0000000 --- a/src/tests/Loader/binding/assemblies/assemblybugs/177066w/repro177066.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - Exe - true - BuildAndRun - 1 - - - - - diff --git a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/properties.cs b/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/properties.cs deleted file mode 100644 index 1ddb52e..0000000 --- a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/properties.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Reflection; -using System.IO; -using System.Globalization; - -public class AssemblyNameCtor_Basic -{ - - public static int Main() - { - bool bFail = false; - //int result = 0; - - try - { - - //Assembly assm1, assm2; - - AssemblyName asmName1 = new AssemblyName (); - asmName1.Name = "server1"; - - AssemblyName asmName2 = new AssemblyName("server1"); - - - Console.WriteLine (asmName1); - Console.WriteLine (asmName2); - if (asmName1==asmName2) - { - Console.WriteLine ("test will fail: asmName1==asmName2"); - bFail = true; - } - - - Console.WriteLine (asmName1.ToString()); - Console.WriteLine (asmName2.ToString()); - if (asmName1.ToString()!=asmName2.ToString()) - { - Console.WriteLine ("test will fail: asmName1.ToString()!=asmName2.ToString()"); - bFail = true; - } - - Console.WriteLine ("PublicKeyToken = " + asmName1.GetPublicKeyToken()); - Console.WriteLine ("PublicKeyToken = " + asmName2.GetPublicKeyToken()); - if (asmName1.GetPublicKeyToken()!=asmName2.GetPublicKeyToken()) - { - Console.WriteLine ("test will fail: asmName1.ToString()!=asmName2.ToString()"); - bFail = true; - } - - - Console.WriteLine ("version = " + asmName1.Version); - Console.WriteLine ("version = " + asmName2.Version); - if (asmName1.Version!=asmName2.Version) - { - Console.WriteLine ("test will fail: asmName1.Version!=asmName2.Version"); - bFail = true; - } -/* - if (asmName1.Version!="0.0.0.0") - { - Console.WriteLine ("test will fail: asmName1.Version.ToString()!=\"0.0.0.0\""); - bFail = true; - } -*/ - - - Console.WriteLine ("******"); - - //Console.WriteLine (asmName2.GetPublicKeyToken().ToString()); - //Console.WriteLine (asmName2.GetPublicKeyToken()); - - Console.WriteLine ("bFail = {0}", bFail); - if (bFail == true) - { - Console.WriteLine ("test failed"); - return 101; - } - - - } - catch (Exception e) - { - Console.WriteLine ("unexpected exception"); - Console.WriteLine (e); - Console.WriteLine ("test failed"); - return 101; - } - - Console.WriteLine ("test passed"); - return 100; - } - -} diff --git a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/properties.csproj b/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/properties.csproj deleted file mode 100644 index 91b97e4..0000000 --- a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/properties.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - Exe - true - BuildAndRun - 1 - -trustedexe - - - - - diff --git a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server1.cs b/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server1.cs deleted file mode 100644 index 6741373..0000000 --- a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server1.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. -using System; -using System.Reflection; - -//[assembly: AssemblyKeyFile("..\\..\\compatkey.dat")] - - -public class server1// : MarshalByRefObject -{ - public int trivial() - { - Console.WriteLine ("server1.trivial"); - Console.WriteLine ("simple named"); - return 1; - } -} diff --git a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server1.csproj b/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server1.csproj deleted file mode 100644 index c9bbe1b..0000000 --- a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server1.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - Library - true - SharedLibrary - 1 - - - - - diff --git a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server2.cs b/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server2.cs deleted file mode 100644 index 3315580..0000000 --- a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server2.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Reflection; - -[assembly: System.Reflection.AssemblyVersion("0.0.0.0")] - -public class server2 -{ - public int trivial() - { - Console.WriteLine ("server2.trivial"); - Console.WriteLine ("strongly named"); - return 2; - } -} diff --git a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server2.csproj b/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server2.csproj deleted file mode 100644 index bca1ecd..0000000 --- a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server2.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - Library - true - SharedLibrary - 1 - - - - - diff --git a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server3.cs b/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server3.cs deleted file mode 100644 index e3ee421..0000000 --- a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server3.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Reflection; - -[assembly: AssemblyVersionAttribute("1.0.0.0")] - -public class server3 -{ - public int trivial() - { - Console.WriteLine ("server3.trivial"); - return 3; - } -} diff --git a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server3.csproj b/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server3.csproj deleted file mode 100644 index b37d068..0000000 --- a/src/tests/Loader/binding/assemblies/basicapi/assemblynamector/server3.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - Library - true - SharedLibrary - 1 - - - - - diff --git a/src/tests/Loader/multimodule/DontUseNetmodule.csproj b/src/tests/Loader/multimodule/DontUseNetmodule.csproj deleted file mode 100644 index 7055640..0000000 --- a/src/tests/Loader/multimodule/DontUseNetmodule.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - Exe - true - BuildAndRun - 1 - - - - - diff --git a/src/tests/Loader/multimodule/dontusenetmodule.cs b/src/tests/Loader/multimodule/dontusenetmodule.cs deleted file mode 100644 index 2e97d67..0000000 --- a/src/tests/Loader/multimodule/dontusenetmodule.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -using System; - -public class B -{ - public int method1() - { - return 100; - } -} - -public class Test -{ - public static int Main() - { - try - { - B obj = new B(); - - if (obj.method1() == 100) - { - Console.WriteLine("PASS"); - return 100; - } - else - { - Console.WriteLine("FAIL"); - return 101; - } - } - catch (Exception e) - { - Console.WriteLine("Caught unexpected exception: " + e); - return 102; - } - } -} diff --git a/src/tests/Loader/versioning/coverage/AssemblyAttrs.csproj b/src/tests/Loader/versioning/coverage/AssemblyAttrs.csproj deleted file mode 100644 index 7e17d42..0000000 --- a/src/tests/Loader/versioning/coverage/AssemblyAttrs.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - Exe - true - BuildAndRun - 1 - - - - - diff --git a/src/tests/Loader/versioning/coverage/assemblyattrs.cs b/src/tests/Loader/versioning/coverage/assemblyattrs.cs deleted file mode 100644 index fbf7d92..0000000 --- a/src/tests/Loader/versioning/coverage/assemblyattrs.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.IO; -using System.Reflection; - -/* - * This is a code coverage test meant to address some low coverage wrt to random Assembly attributes - * AssemblyCompanyAttribute - * AssemblyCopyrightAttribute - * AssemblyCultureAttribute - * AssemblyFileVersionAttribute - * AssemblyInformationalVersion - * AssemblyProductAttribute - * AssemblyTrademarkAttribute - * AssemblyVersionAttribute - */ - -public class AssemblyName -{ - public static int Main() - { - //random Assembly Attributes - Console.WriteLine((new AssemblyCompanyAttribute("my company")).Company); - Console.WriteLine((new AssemblyCopyrightAttribute("my copyright")).Copyright); - Console.WriteLine((new AssemblyCultureAttribute("my culture")).Culture); - Console.WriteLine((new AssemblyFileVersionAttribute("my version")).ToString()); - try - { - new AssemblyFileVersionAttribute(null); - } - catch(ArgumentNullException) - {} - Console.WriteLine((new AssemblyInformationalVersionAttribute("my informational")).InformationalVersion); - Console.WriteLine((new AssemblyProductAttribute("my product")).Product); - Console.WriteLine((new AssemblyTrademarkAttribute("my trademark")).Trademark); - Console.WriteLine((new AssemblyVersionAttribute("my version")).Version); - return 100; - } -}