From b3347f231847c38c3abe1027f2a6ec47e4bb41a7 Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Mon, 10 May 2021 12:04:25 -0400 Subject: [PATCH] Fix style nits; add more copyright headers --- .../MethodBody1.cs | 2 ++ .../MethodBody1_v1.cs | 2 ++ .../MethodBody1_v2.cs | 2 ++ .../System.Runtime.Loader/tests/ApplyUpdateTest.cs | 5 ++--- .../System.Runtime.Loader/tests/ApplyUpdateUtil.cs | 12 ++++++------ 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1.cs index a58a038f685d17..22b259c2f81059 100644 --- a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1.cs +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1.cs @@ -1,3 +1,5 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Reflection.Metadata.ApplyUpdate.Test { diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1_v1.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1_v1.cs index 2c514ed7943473..1fee80ba1bdb4d 100644 --- a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1_v1.cs +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1_v1.cs @@ -1,3 +1,5 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Reflection.Metadata.ApplyUpdate.Test { diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1_v2.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1_v2.cs index 47814274c11536..3fefeeaa3f2f89 100644 --- a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1_v2.cs +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.MethodBody1/MethodBody1_v2.cs @@ -1,3 +1,5 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Reflection.Metadata.ApplyUpdate.Test { diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs index a28a92e1b72e81..57c71039774d89 100644 --- a/src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs @@ -17,11 +17,11 @@ namespace System.Reflection.Metadata [ConditionalClass(typeof(ApplyUpdateUtil), nameof (ApplyUpdateUtil.IsSupported))] public class ApplyUpdateTest { - [Fact] void StaticMethodBodyUpdate() { - ApplyUpdateUtil.TestCase(static () => { + ApplyUpdateUtil.TestCase(static () => + { var assm = typeof (ApplyUpdate.Test.MethodBody1).Assembly; var r = ApplyUpdate.Test.MethodBody1.StaticMethod1(); @@ -38,6 +38,5 @@ void StaticMethodBodyUpdate() Assert.Equal ("NEWEST STRING", r); }); } - } } diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdateUtil.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdateUtil.cs index 0841a16fefa828..baa5ac27b76b1b 100644 --- a/src/libraries/System.Runtime.Loader/tests/ApplyUpdateUtil.cs +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdateUtil.cs @@ -8,16 +8,13 @@ namespace System.Reflection.Metadata { - public class ApplyUpdateUtil { internal const string DotNetModifiableAssembliesSwitch = "DOTNET_MODIFIABLE_ASSEMBLIES"; internal const string DotNetModifiableAssembliesValue = "debug"; - [CollectionDefinition("NoParallelTests", DisableParallelization = true)] public class NoParallelTests { } - /// Whether ApplyUpdate is supported by the environment, test configuration, and runtime. /// /// We need: @@ -74,7 +71,7 @@ internal static bool IsSupportedTestConfiguration() #endif } - private static System.Collections.Generic.Dictionary assembly_count = new (); + private static System.Collections.Generic.Dictionary assembly_count = new(); internal static void ApplyUpdate (System.Reflection.Assembly assm) { @@ -115,11 +112,14 @@ internal static void AddRemoteInvokeOptions (ref RemoteInvokeOptions options) public static void TestCase(Action testBody, RemoteInvokeOptions options = null) { - if (UseRemoteExecutor) { + if (UseRemoteExecutor) + { Console.Error.WriteLine ($"Running test using RemoteExecutor"); AddRemoteInvokeOptions(ref options); RemoteExecutor.Invoke(testBody, options).Dispose(); - } else { + } + else + { Console.Error.WriteLine($"Running test using direct invoke"); testBody(); }