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
run some code when loading from byte array
  • Loading branch information
VSadov committed Aug 19, 2022
commit c2061d988ebcde5189c716987f51561e7eebd2a5
9 changes: 9 additions & 0 deletions src/tests/readytorun/tests/main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,13 @@ static void RVAFieldTest()
Assert.AreEqual(value[i], (byte)(9 - i));
}

// public constructor, so we run something when loading from byte array in the test below
public Program()
{
// do somehting in the constructor to see if it works
TestVirtualMethodCalls();
}

static void TestLoadR2RImageFromByteArray()
{
Assembly assembly1 = typeof(Program).Assembly;
Expand All @@ -422,6 +429,8 @@ static void TestLoadR2RImageFromByteArray()
Assembly assembly2 = Assembly.Load(array);

Assert.AreEqual(assembly2.FullName, assembly1.FullName);

assembly2.CreateInstance("Program");
}

[MethodImplAttribute(MethodImplOptions.NoInlining)]
Expand Down