From 5dc70c394ad76dca6b833db75d87a310dfc64480 Mon Sep 17 00:00:00 2001 From: Buyaa Namnan Date: Tue, 31 May 2022 20:29:20 -0700 Subject: [PATCH 1/3] Enable test that already fixed --- src/libraries/System.Reflection.Emit/tests/Utilities.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Reflection.Emit/tests/Utilities.cs b/src/libraries/System.Reflection.Emit/tests/Utilities.cs index 1e951be849a86..bc327f04b4b6a 100644 --- a/src/libraries/System.Reflection.Emit/tests/Utilities.cs +++ b/src/libraries/System.Reflection.Emit/tests/Utilities.cs @@ -105,10 +105,9 @@ public static void VerifyType(TypeBuilder type, Module module, TypeBuilder decla Assert.Equal(type.AsType().GetNestedTypes(AllFlags), createdType.GetNestedTypes(AllFlags)); Assert.Equal(type.AsType().GetNestedType(name, AllFlags), createdType.GetNestedType(name, AllFlags)); - // [ActiveIssue("https://github.com/dotnet/runtime/issues/18231", TestPlatforms.AnyUnix)] - // Assert.Equal(createdType, module.GetType(name, true, true)); - // Assert.Equal(createdType, module.GetType(name.ToLowerInvariant(), true, true)); - // Assert.Equal(createdType, module.GetType(name.ToUpperInvariant(), true, true)); + Assert.Equal(createdType, module.GetType(name, true, true)); + Assert.Equal(createdType, module.GetType(name.ToLowerInvariant(), true, true)); + Assert.Equal(createdType, module.GetType(name.ToUpperInvariant(), true, true)); } } From ccdc0e2d6fce5245e85bb6386eaa7a7b9922aa57 Mon Sep 17 00:00:00 2001 From: Buyaa Namnan Date: Wed, 1 Jun 2022 12:28:27 -0700 Subject: [PATCH 2/3] Disable on mono --- .../System.Reflection.Emit/tests/Utilities.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Reflection.Emit/tests/Utilities.cs b/src/libraries/System.Reflection.Emit/tests/Utilities.cs index bc327f04b4b6a..54faffa80b09f 100644 --- a/src/libraries/System.Reflection.Emit/tests/Utilities.cs +++ b/src/libraries/System.Reflection.Emit/tests/Utilities.cs @@ -105,9 +105,13 @@ public static void VerifyType(TypeBuilder type, Module module, TypeBuilder decla Assert.Equal(type.AsType().GetNestedTypes(AllFlags), createdType.GetNestedTypes(AllFlags)); Assert.Equal(type.AsType().GetNestedType(name, AllFlags), createdType.GetNestedType(name, AllFlags)); - Assert.Equal(createdType, module.GetType(name, true, true)); - Assert.Equal(createdType, module.GetType(name.ToLowerInvariant(), true, true)); - Assert.Equal(createdType, module.GetType(name.ToUpperInvariant(), true, true)); + if (!PlatformDetection.IsMonoRuntime) + { + // [ActiveIssue("https://github.com/dotnet/runtime/issues/18231", TestRuntimes.Mono)] + Assert.Equal(createdType, module.GetType(name, true, true)); + Assert.Equal(createdType, module.GetType(name.ToLowerInvariant(), true, true)); + Assert.Equal(createdType, module.GetType(name.ToUpperInvariant(), true, true)); + } } } From bf47dad5c695b7c4418172d05f6c1c27a20498d8 Mon Sep 17 00:00:00 2001 From: Buyaa Namnan Date: Wed, 1 Jun 2022 15:33:02 -0700 Subject: [PATCH 3/3] Remove invalid test case and enable tests on mono --- .../tests/ModuleBuilder/ModuleBuilderDefineType.cs | 2 +- .../System.Reflection.Emit/tests/Utilities.cs | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineType.cs b/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineType.cs index 851a0afcb0896..a4b5ecb392f02 100644 --- a/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineType.cs +++ b/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineType.cs @@ -10,7 +10,7 @@ public class ModuleBuilderDefineType { public static IEnumerable TestData() { - foreach (string name in new string[] { "TestName", "testname", "class", "\uD800\uDC00", "a\0b\0c" }) + foreach (string name in new string[] { "TestName", "testname", "class", "\uD800\uDC00" }) { foreach (TypeAttributes attributes in new TypeAttributes[] { TypeAttributes.NotPublic, TypeAttributes.Interface | TypeAttributes.Abstract, TypeAttributes.Class }) { diff --git a/src/libraries/System.Reflection.Emit/tests/Utilities.cs b/src/libraries/System.Reflection.Emit/tests/Utilities.cs index 54faffa80b09f..bc327f04b4b6a 100644 --- a/src/libraries/System.Reflection.Emit/tests/Utilities.cs +++ b/src/libraries/System.Reflection.Emit/tests/Utilities.cs @@ -105,13 +105,9 @@ public static void VerifyType(TypeBuilder type, Module module, TypeBuilder decla Assert.Equal(type.AsType().GetNestedTypes(AllFlags), createdType.GetNestedTypes(AllFlags)); Assert.Equal(type.AsType().GetNestedType(name, AllFlags), createdType.GetNestedType(name, AllFlags)); - if (!PlatformDetection.IsMonoRuntime) - { - // [ActiveIssue("https://github.com/dotnet/runtime/issues/18231", TestRuntimes.Mono)] - Assert.Equal(createdType, module.GetType(name, true, true)); - Assert.Equal(createdType, module.GetType(name.ToLowerInvariant(), true, true)); - Assert.Equal(createdType, module.GetType(name.ToUpperInvariant(), true, true)); - } + Assert.Equal(createdType, module.GetType(name, true, true)); + Assert.Equal(createdType, module.GetType(name.ToLowerInvariant(), true, true)); + Assert.Equal(createdType, module.GetType(name.ToUpperInvariant(), true, true)); } }