-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Add some tests to System.Reflection.Emit #10532
Conversation
- DefineDynamicAssembly - DefineDynamicModule - DefineDynamicType - DefineDynamicEnum - {G|S}etCustomAttribute
I'm a little confused as to why the non-Windows builds are failing - any ideas would be appreciated! |
I've been pulled off to some crit-path stuff outside of x-plat so I really can't devote time to test reorganizations right now. Sorry. |
Don't worry! |
|
||
Assert.Equal(1, assembly.Modules.Count()); | ||
Module module = assembly.Modules.First(); | ||
Assert.Equal("<In Memory Module>", module.Name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this module name defined? I'm wondering if this string is coming from the product source and might be localized such that this could fail in non-English builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's defined here: https://github.com/dotnet/coreclr/blob/master/src/dlls/mscorrc/mscorrc.common.rc
I think it is localisable, so I've changed it to Assert.NotEmpty instead
@dotnet-bot test this please |
One comment/question, otherwise LGTM. Thanks. |
@stephentoub Thank's for the review, but what about the failing non-windows builds? |
It looks like it's having trouble with defining/loading types that have special Unicode characters in them. Have you tried narrowing down to exactly which inputs are causing the problem? Presumably it's "\uD800\uDC00" in the type name? |
@stephentoub thanks. I've taken a look, it seems that ModuleBuilder.GetType doesn't work with "\uD800\uDC00" when the |
Thanks for investigating, @hughbe. |
Tests that were deleted (e.g. for EnumBuilder, TypeBuilder) have been moved to a different file (e.g ModuleBuilderDefineEnum or ModuleBuilderDefineType)