1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-09 09:34:49 +09:00

Add extra Module.ModuleHandle test (#72875)

* Add extra Module.ModuleHandle test

* Update src/libraries/System.Runtime/tests/System/Reflection/ModuleTests.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

* Fix mono implementation

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
This commit is contained in:
Marek Safar 2022-07-28 08:13:35 +02:00 committed by GitHub
parent 490d3ceccc
commit 93900881bc
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View file

@ -54,6 +54,7 @@ namespace System.Reflection.Tests
public void ModuleHandle()
{
Assert.Equal(typeof(PointerTests).Module.ModuleHandle, Module.ModuleHandle);
Assert.NotEqual(typeof(PointerTests).Module.ModuleHandle, System.ModuleHandle.EmptyHandle);
}
[Fact]

View file

@ -775,6 +775,8 @@ namespace System.Reflection.Emit
internal IntPtr GetUnderlyingNativeHandle() { return _impl; }
protected override ModuleHandle GetModuleHandleImpl() => new ModuleHandle(_impl);
[RequiresUnreferencedCode("Methods might be removed")]
protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers)
{

View file

@ -394,6 +394,8 @@ namespace System.Reflection
internal IntPtr GetUnderlyingNativeHandle() { return _impl; }
protected override ModuleHandle GetModuleHandleImpl() => new ModuleHandle(_impl);
// This calls ves_icall_reflection_get_token, so needs a Module argument
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern int get_MetadataToken(Module module);