diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/ExecutionDomain.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/ExecutionDomain.cs index 181b2ad0513fbdd15dd9f26112281b60de4d1556..84617796861634403920e90c7fa20aa132c3104d 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/ExecutionDomain.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/ExecutionDomain.cs @@ -42,7 +42,7 @@ internal ExecutionDomain(ReflectionDomainSetup executionDomainSetup, ExecutionEn public Type GetType(string typeName, Func assemblyResolver, Func typeResolver, bool throwOnError, bool ignoreCase, IList defaultAssemblyNames) { if (typeName == null) - throw new ArgumentNullException(); + throw new ArgumentNullException(nameof(typeName)); if (typeName.Length == 0) { diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs index 37c6f5b03b9f9bf3c2af8ccd1c55fdf113c5d145..299d73cfe31502265f1f7625388161b94fdc07aa 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs @@ -13,7 +13,7 @@ namespace System.ComponentModel.Tests [Collection(nameof(DisableParallelization))] // manipulates cache public class TypeDescriptorTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProvider_InvokeObject_GetProviderReturnsExpected() { var instance = new object(); @@ -47,7 +47,7 @@ public void AddProvider_InvokeObject_GetProviderReturnsExpected() mockProvider2.Verify(p => p.IsSupportedType(typeof(int)), Times.Once()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProvider_InvokeObjectMultipleTimes_Refreshes() { var instance = new object(); @@ -96,7 +96,7 @@ public void AddProvider_InvokeObjectMultipleTimes_Refreshes() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProvider_InvokeType_GetProviderReturnsExpected() { Type type = typeof(AddProvider_InvokeType_GetProviderReturnsExpectedType); @@ -133,7 +133,7 @@ public void AddProvider_InvokeType_GetProviderReturnsExpected() private class AddProvider_InvokeType_GetProviderReturnsExpectedType { } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProvider_InvokeTypeMultipleTimes_Refreshes() { var type = typeof(AddProvider_InvokeTypeMultipleTimes_RefreshesType); @@ -184,28 +184,28 @@ public void AddProvider_InvokeTypeMultipleTimes_Refreshes() private class AddProvider_InvokeTypeMultipleTimes_RefreshesType { } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProvider_NullProvider_ThrowsArgumentNullException() { Assert.Throws("provider", () => TypeDescriptor.AddProvider(null, new object())); Assert.Throws("provider", () => TypeDescriptor.AddProvider(null, typeof(int))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProvider_NullInstance_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); Assert.Throws("instance", () => TypeDescriptor.AddProvider(mockProvider.Object, (object)null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProvider_NullType_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); Assert.Throws("type", () => TypeDescriptor.AddProvider(mockProvider.Object, null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProviderTransparent_InvokeObject_GetProviderReturnsExpected() { var instance = new object(); @@ -239,7 +239,7 @@ public void AddProviderTransparent_InvokeObject_GetProviderReturnsExpected() mockProvider2.Verify(p => p.IsSupportedType(typeof(int)), Times.Once()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProviderTransparent_InvokeObjectMultipleTimes_Refreshes() { var instance = new object(); @@ -288,7 +288,7 @@ public void AddProviderTransparent_InvokeObjectMultipleTimes_Refreshes() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProviderTransparent_InvokeType_GetProviderReturnsExpected() { Type type = typeof(AddProviderTransparent_InvokeType_GetProviderReturnsExpectedType); @@ -324,7 +324,7 @@ public void AddProviderTransparent_InvokeType_GetProviderReturnsExpected() private class AddProviderTransparent_InvokeType_GetProviderReturnsExpectedType { } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProviderTransparent_InvokeTypeMultipleTimes_Refreshes() { var type = typeof(AddProviderTransparent_InvokeTypeMultipleTimes_RefreshesType); @@ -375,21 +375,21 @@ public void AddProviderTransparent_InvokeTypeMultipleTimes_Refreshes() private class AddProviderTransparent_InvokeTypeMultipleTimes_RefreshesType { } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProviderTransparent_NullProvider_ThrowsArgumentNullException() { Assert.Throws("provider", () => TypeDescriptor.AddProviderTransparent(null, new object())); Assert.Throws("provider", () => TypeDescriptor.AddProviderTransparent(null, typeof(int))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProviderTransparent_NullInstance_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); Assert.Throws("instance", () => TypeDescriptor.AddProviderTransparent(mockProvider.Object, (object)null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void AddProviderTransparent_NullType_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); @@ -548,7 +548,7 @@ public void GetPropertiesFiltersByAttribute() Assert.Equal(1, properties.Count); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProvider_InvokeObject_RemovesProvider() { var instance = new object(); @@ -603,7 +603,7 @@ public void RemoveProvider_InvokeObject_RemovesProvider() mockProvider3.Verify(p => p.IsSupportedType(typeof(int)), Times.Once()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProvider_InvokeObjectWithProviders_Refreshes() { var instance = new object(); @@ -640,7 +640,7 @@ public void RemoveProvider_InvokeObjectWithProviders_Refreshes() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProvider_InvokeObjectWithoutProviders_Refreshes() { var instance = new object(); @@ -665,7 +665,7 @@ public void RemoveProvider_InvokeObjectWithoutProviders_Refreshes() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProvider_InvokeType_RemovesProvider() { Type type = typeof(RemoveProvider_InvokeType_RemovesProviderType); @@ -722,7 +722,7 @@ public void RemoveProvider_InvokeType_RemovesProvider() private class RemoveProvider_InvokeType_RemovesProviderType { } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProvider_InvokeTypeWithProviders_Refreshes() { Type type = typeof(RemoveProvider_InvokeObjectWithProviders_RefreshesType); @@ -761,7 +761,7 @@ public void RemoveProvider_InvokeTypeWithProviders_Refreshes() private class RemoveProvider_InvokeObjectWithProviders_RefreshesType { } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProvider_InvokeTypeWithoutProviders_Refreshes() { Type type = typeof(RemoveProvider_InvokeTypeWithoutProviders_RefreshesType); @@ -795,14 +795,14 @@ public void RemoveProvider_NullProvider_ThrowsArgumentNullException() Assert.Throws("provider", () => TypeDescriptor.RemoveProvider(null, typeof(int))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProvider_NullInstance_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); Assert.Throws("instance", () => TypeDescriptor.RemoveProvider(mockProvider.Object, (object)null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProvider_NullType_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); @@ -810,7 +810,7 @@ public void RemoveProvider_NullType_ThrowsArgumentNullException() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeObject_RemovesProvider() { var instance = new object(); @@ -865,7 +865,7 @@ public void RemoveProviderTransparent_InvokeObject_RemovesProvider() mockProvider3.Verify(p => p.IsSupportedType(typeof(int)), Times.Once()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeObjectWithProviders_Refreshes() { var instance = new object(); @@ -902,7 +902,7 @@ public void RemoveProviderTransparent_InvokeObjectWithProviders_Refreshes() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeObjectWithoutProviders_Refreshes() { var instance = new object(); @@ -927,7 +927,7 @@ public void RemoveProviderTransparent_InvokeObjectWithoutProviders_Refreshes() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeType_RemovesProvider() { Type type = typeof(RemoveProviderTransparent_InvokeType_RemovesProviderType); @@ -984,7 +984,7 @@ public void RemoveProviderTransparent_InvokeType_RemovesProvider() private class RemoveProviderTransparent_InvokeType_RemovesProviderType { } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeTypeWithProviders_Refreshes() { Type type = typeof(RemoveProviderTransparent_InvokeObjectWithProviders_RefreshesType); @@ -1023,7 +1023,7 @@ public void RemoveProviderTransparent_InvokeTypeWithProviders_Refreshes() private class RemoveProviderTransparent_InvokeObjectWithProviders_RefreshesType { } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeTypeWithoutProviders_Refreshes() { Type type = typeof(RemoveProviderTransparent_InvokeTypeWithoutProviders_RefreshesType); @@ -1057,14 +1057,14 @@ public void RemoveProviderTransparent_NullProvider_ThrowsArgumentNullException() Assert.Throws("provider", () => TypeDescriptor.RemoveProviderTransparent(null, typeof(int))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProviderTransparent_NullInstance_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); Assert.Throws("instance", () => TypeDescriptor.RemoveProviderTransparent(mockProvider.Object, (object)null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void RemoveProviderTransparent_NullType_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); @@ -1111,7 +1111,7 @@ public void RemoveSingleAssociation() Assert.NotEqual(firstAssociatedObject, firstAssociation); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Mock will try to JIT public void SortDescriptorArray_Invoke_ReturnsExpected() { var notADescriptor1 = new object(); diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/XTypeDescriptionProviderTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/XTypeDescriptionProviderTests.cs index 7dde31b29544f55cd03a7d9a080ffef8eb89455c..7bdba591a133e5aeea300d92fbf61aebd12050ac 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/XTypeDescriptionProviderTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/XTypeDescriptionProviderTests.cs @@ -12,7 +12,7 @@ namespace System.Xml.Linq.Tests { public class XTypeDescriptionProviderTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))] public void XAttributeValuePropertyDescriptor() { var xatt = new XAttribute("someAttribute", "someValue"); @@ -41,7 +41,7 @@ public void XAttributeValuePropertyDescriptor() Assert.Equal(newValue, xatt.Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))] public void XElementAttributePropertyDescriptor() { var xel = new XElement("someElement"); @@ -117,7 +117,7 @@ public void XElementAttributePropertyDescriptor() Assert.True(valueChanged); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))] public void XElementDescendantsPropertyDescriptor() { var xel = new XElement("someElement"); @@ -150,7 +150,7 @@ public void XElementDescendantsPropertyDescriptor() Assert.True(valueChanged); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))] public void XElementElementPropertyDescriptor() { var xel = new XElement("someElement"); @@ -225,7 +225,7 @@ public void XElementElementPropertyDescriptor() Assert.True(valueChanged); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))] public void XElementElementsPropertyDescriptor() { var xel = new XElement("someElement"); @@ -258,7 +258,7 @@ public void XElementElementsPropertyDescriptor() Assert.True(valueChanged); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))] public void XElementValuePropertyDescriptor() { var xel = new XElement("someElement", "someValue"); @@ -292,7 +292,7 @@ public void XElementValuePropertyDescriptor() Assert.Equal(xel.Value, xelValPD.GetValue(xel)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))] public void XElementXmlPropertyDescriptor() { var xel = new XElement("someElement"); diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index da787c4710b61cc53c41999b9983cfe974db1a91..afba0d8a60ee23924c987183255ea935bd108310 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -503,7 +503,6 @@ -