Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix test on coreclr
  • Loading branch information
lambdageek committed Oct 28, 2022
commit 55b28924d33a7653201534f0930fa806ef749e26
10 changes: 7 additions & 3 deletions src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -638,14 +638,18 @@ public static void TestReflectionAddNewMethod()
var ty = typeof(System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewMethod);
var assm = ty.Assembly;

var allMethods = ty.GetMethods();
var bindingFlags = BindingFlags.Instance | BindingFlags.Public;
var allMethods = ty.GetMethods(bindingFlags);

const int objectMethods = 4;
int objectMethods = typeof(object).GetMethods(bindingFlags).Length;
Assert.Equal (objectMethods + 1, allMethods.Length);

ApplyUpdateUtil.ApplyUpdate(assm);
ApplyUpdateUtil.ClearAllReflectionCaches();

ty = typeof(System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewMethod);

allMethods = ty.GetMethods();
allMethods = ty.GetMethods(bindingFlags);
Assert.Equal (objectMethods + 2, allMethods.Length);

var mi = ty.GetMethod ("AddedNewMethod");
Expand Down