diff options
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/Reflection/EventUsedViaReflection.cs')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/Reflection/EventUsedViaReflection.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Reflection/EventUsedViaReflection.cs b/test/Mono.Linker.Tests.Cases/Reflection/EventUsedViaReflection.cs index ba33cdc4e..5f93cf879 100644 --- a/test/Mono.Linker.Tests.Cases/Reflection/EventUsedViaReflection.cs +++ b/test/Mono.Linker.Tests.Cases/Reflection/EventUsedViaReflection.cs @@ -17,6 +17,7 @@ namespace Mono.Linker.Tests.Cases.Reflection TestNameBindingFlags (); TestNameWrongBindingFlags (); TestNameUnknownBindingFlags (BindingFlags.Public); + TestNameUnknownBindingFlagsAndName (BindingFlags.Public, "DoesntMatter"); TestNullName (); TestEmptyName (); TestNonExistingName (); @@ -72,6 +73,13 @@ namespace Mono.Linker.Tests.Cases.Reflection } [Kept] + static void TestNameUnknownBindingFlagsAndName (BindingFlags bindingFlags, string name) + { + // Since the binding flags are not known linker should mark all events on the type + var eventInfo = typeof (UnknownBindingFlagsAndName).GetEvent (name, bindingFlags); + } + + [Kept] static void TestNullName () { var eventInfo = typeof (EventUsedViaReflection).GetEvent (null); @@ -221,6 +229,30 @@ namespace Mono.Linker.Tests.Cases.Reflection public event EventHandler<EventArgs> PublicEvent; } + class UnknownBindingFlagsAndName + { + [Kept] + [KeptEventAddMethod] + [KeptEventRemoveMethod] + [method: ExpectBodyModified] + internal event EventHandler<EventArgs> InternalEvent; + [Kept] + [KeptBackingField] + [KeptEventAddMethod] + [KeptEventRemoveMethod] + static event EventHandler<EventArgs> Static; + [Kept] + [KeptEventAddMethod] + [KeptEventRemoveMethod] + [method: ExpectBodyModified] + private event EventHandler<EventArgs> PrivateEvent; + [Kept] + [KeptEventAddMethod] + [KeptEventRemoveMethod] + [method: ExpectBodyModified] + public event EventHandler<EventArgs> PublicEvent; + } + class IfClass { [Kept] |