From be051de30a16bcc62e158c70950dcd9ff835602b Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Mon, 13 Jan 2020 19:06:55 +0300 Subject: [PATCH] [netcore] Make System.Diagnostics.TraceSourceTests.DefaultTraceListenerClassTests.EntryAssemblyName_Null_NotIncludedInTrace Pass (mono/mono#18403) * [netcore] Extract Assembly.GetEntryAssembly method to shared part Commit migrated from https://github.com/mono/mono/commit/87cfaf15ae8687524b1f18e21c85a2680d7fe5e0 --- src/mono/mono/metadata/icall-def-netcore.h | 2 +- src/mono/netcore/CoreFX.issues.rsp | 8 -------- .../System.Private.CoreLib/src/System/Reflection/Assembly.Mono.cs | 7 ++++++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/mono/mono/metadata/icall-def-netcore.h b/src/mono/mono/metadata/icall-def-netcore.h index 41b130e..fbcbb58 100644 --- a/src/mono/mono/metadata/icall-def-netcore.h +++ b/src/mono/mono/metadata/icall-def-netcore.h @@ -175,7 +175,7 @@ HANDLES(OBJ_3, "MemberwiseClone", ves_icall_System_Object_MemberwiseClone, MonoO ICALL_TYPE(ASSEM, "System.Reflection.Assembly", ASSEM_2) HANDLES(ASSEM_2, "GetCallingAssembly", ves_icall_System_Reflection_Assembly_GetCallingAssembly, MonoReflectionAssembly, 0, ()) -HANDLES(ASSEM_3, "GetEntryAssembly", ves_icall_System_Reflection_Assembly_GetEntryAssembly, MonoReflectionAssembly, 0, ()) +HANDLES(ASSEM_3, "GetEntryAssemblyNative", ves_icall_System_Reflection_Assembly_GetEntryAssembly, MonoReflectionAssembly, 0, ()) HANDLES(ASSEM_4, "GetExecutingAssembly", ves_icall_System_Reflection_Assembly_GetExecutingAssembly, MonoReflectionAssembly, 1, (MonoStackCrawlMark_ptr)) HANDLES(ASSEM_5, "InternalGetAssemblyName", ves_icall_System_Reflection_Assembly_InternalGetAssemblyName, void, 3, (MonoString, MonoAssemblyName_ref, MonoStringOut)) HANDLES(ASSEM_6, "InternalGetType", ves_icall_System_Reflection_Assembly_InternalGetType, MonoReflectionType, 5, (MonoReflectionAssembly, MonoReflectionModule, MonoString, MonoBoolean, MonoBoolean)) diff --git a/src/mono/netcore/CoreFX.issues.rsp b/src/mono/netcore/CoreFX.issues.rsp index 8d1b849..fd840b4 100644 --- a/src/mono/netcore/CoreFX.issues.rsp +++ b/src/mono/netcore/CoreFX.issues.rsp @@ -27,14 +27,6 @@ -nomethod System.Collections.Specialized.Tests.NameValueCollectionCtorTests.Ctor_NegativeCapacity_ThrowsArgumentOutOfRangeException #################################################################### -## System.Diagnostics.TraceSource.Tests -#################################################################### - -# Object reference not set to an instance of an object on DefaultTraceListenerClassTests.MakeAssemblyGetEntryAssemblyReturnNull -# https://github.com/mono/mono/issues/14905 --nomethod System.Diagnostics.TraceSourceTests.DefaultTraceListenerClassTests.EntryAssemblyName_Null_NotIncludedInTrace - -#################################################################### ## System.Diagnostics.Tracing.Tests #################################################################### diff --git a/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/Assembly.Mono.cs b/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/Assembly.Mono.cs index affd493..a8ac733 100644 --- a/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/Assembly.Mono.cs +++ b/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/Assembly.Mono.cs @@ -46,7 +46,12 @@ namespace System.Reflection public static extern Assembly GetCallingAssembly (); [MethodImplAttribute (MethodImplOptions.InternalCall)] - public static extern Assembly GetEntryAssembly (); + internal static extern Assembly GetEntryAssemblyNative (); + + private static Assembly? GetEntryAssemblyInternal () + { + return GetEntryAssemblyNative (); + } [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static Assembly Load (string assemblyString) -- 2.7.4