Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
51 changes: 0 additions & 51 deletions src/libraries/Common/tests/System/Reflection/InvokeEmitTests.cs

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@ public void Ctor_FNeedFileInfo(bool fNeedFileInfo)
VerifyStackFrame(stackFrame, fNeedFileInfo, 0, typeof(StackFrameTests).GetMethod(nameof(Ctor_FNeedFileInfo)));
}

[Theory]
[ActiveIssue("https://github.com/mono/mono/issues/15183", TestRuntimes.Mono)]
[InlineData(StackFrame.OFFSET_UNKNOWN)]
[InlineData(0)]
[InlineData(1)]
public void Ctor_SkipFrames(int skipFrames)
{
var stackFrame = new StackFrame(skipFrames);
VerifyStackFrame(stackFrame, true, skipFrames, typeof(StackFrameTests).GetMethod(nameof(Ctor_SkipFrames)), isCurrentFrame: skipFrames == 0);
}

[Theory]
[ActiveIssue("https://github.com/mono/mono/issues/15187", TestRuntimes.Mono)]
[InlineData(StackFrame.OFFSET_UNKNOWN, true)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,22 @@ public void Invoke_Struct()
Assert.Equal(1, obj.x);
Assert.Equal(2, obj.y);
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))]
public static void VerifyInnerException()
{
ConstructorInfo ctor = typeof(TestClassThatThrows).GetConstructor(Type.EmptyTypes)!;
TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => ctor.Invoke(null));
Assert.Contains("Here", ex.InnerException.ToString());
}

private class TestClassThatThrows
{
public TestClassThatThrows()
{
throw new Exception("Here");
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TestRuntime>true</TestRuntime>
Expand All @@ -14,7 +14,6 @@
<Compile Include="..\MethodInfoTests.cs" />
<Compile Include="..\MethodInvokerTests.cs" />
<Compile Include="..\PropertyInfoTests.cs" />
<Compile Include="$(CommonTestPath)\System\Reflection\InvokeEmitTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TestAssembly\TestAssembly.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<Compile Include="..\MethodInfoTests.cs" />
<Compile Include="..\MethodInvokerTests.cs" />
<Compile Include="..\PropertyInfoTests.cs" />
<Compile Include="$(CommonTestPath)\System\Reflection\InvokeInterpretedTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TestAssembly\TestAssembly.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,19 @@ public unsafe void TestFunctionPointerAsReturnType()
Assert.IsType<IntPtr>(ret);
Assert.True((IntPtr)ret != 0);
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))]
public static void VerifyInnerException()
{
MethodInfo method = typeof(TestClassThatThrows).GetMethod(nameof(TestClassThatThrows.Throw))!;
TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => method.Invoke(null, null));
Assert.Contains("Here", ex.InnerException.ToString());
}

private class TestClassThatThrows
{
public static void Throw() => throw new Exception("Here");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<Compile Include="..\InvokeRefReturn.cs" />
<Compile Include="..\InvokeWithRefLikeArgs.cs" />
<Compile Include="..\PointerTests.cs" />
<Compile Include="$(CommonTestPath)\System\Reflection\InvokeEmitTests.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<Compile Include="..\InvokeRefReturn.cs" />
<Compile Include="..\InvokeWithRefLikeArgs.cs" />
<Compile Include="..\PointerTests.cs" />
<Compile Include="$(CommonTestPath)\System\Reflection\InvokeInterpretedTests.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
Expand Down
Loading