Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Add more test coverage for System.Reflection.Pointer #28143

Merged
merged 2 commits into from
Mar 19, 2018

Conversation

MichalStrehovsky
Copy link
Member

  • Test that null object reference is properly converted to a null pointer value (this requires special handling)
  • Test Delegate.DynamicInvoke. This one also uses System.Reflection.Pointer and on .NET Native is handled by separate code paths.

Currently adding as disabled on UapAot because I'm working on that support right now. We'll unblock it with the rest later.

Cc @sergiy-k

* Test that null object reference is properly converted to a null pointer value (this requires special handling)
* Test `Delegate.DynamicInvoke`. This one also uses `System.Reflection.Pointer` and on .NET Native is handled by separate code paths.
@MichalStrehovsky
Copy link
Member Author

@dotnet-bot test Linux x64 Release Build
@dotnet-bot test OSX x64 Debug Build
@dotnet-bot test Windows x86 Release Build

{
var obj = new PointerHolder();
MethodInfo method = typeof(PointerHolder).GetMethod("Method");
method.Invoke(obj, new object[] { null, 0 });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything to assert, or we're just verifying it doesn't throw/crash?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The body of the invoked method has Assert.Equal(expected, unchecked((int)ptr));

@MichalStrehovsky MichalStrehovsky merged commit b287402 into dotnet:master Mar 19, 2018
@MichalStrehovsky MichalStrehovsky deleted the morePointerTests branch March 19, 2018 06:55
@karelz karelz added this to the 2.1.0 milestone Mar 27, 2018
ericstj pushed a commit to ericstj/corefx that referenced this pull request Mar 28, 2018
* Test that null object reference is properly converted to a null pointer value (this requires special handling)
* Test `Delegate.DynamicInvoke`. This one also uses `System.Reflection.Pointer` and on .NET Native is handled by separate code paths.
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…8143)

* Test that null object reference is properly converted to a null pointer value (this requires special handling)
* Test `Delegate.DynamicInvoke`. This one also uses `System.Reflection.Pointer` and on .NET Native is handled by separate code paths.

Commit migrated from dotnet/corefx@b287402
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants