Skip to content

Commit

Permalink
Update assert enable tests for CoreCLR (#105266)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronRobinsonMSFT authored Jul 22, 2024
1 parent fc6ce2c commit d46fdc1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ protected virtual MethodInfo GetMethodImpl()
// RCWs don't need to be "strongly-typed" in which case we don't find a base type
// that matches the declaring type of the method. This is fine because interop needs
// to work with exact methods anyway so declaringType is never shared at this point.
Debug.Assert(currentType != null || _target.GetType().IsCOMObject, "The class hierarchy should declare the method");
// The targetType may also be an interface with a Default interface method (DIM).
Debug.Assert(
currentType != null
|| _target.GetType().IsCOMObject
|| targetType.IsInterface, "The class hierarchy should declare the method or be a DIM");
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,20 @@ public static IEnumerable<object[]> Create_ClosedDelegate_TestData()

IGenericInterfaceForDiagnosticMethodInfoTests<object> og = new GenericClassForDiagnosticMethodInfoTests<object>();

// Making this work with CoreCLR tracked in https://github.com/dotnet/runtime/issues/103268
if (PlatformDetection.IsMonoRuntime || PlatformDetection.IsNativeAot)
// Making this work with native AOT tracked in https://github.com/dotnet/runtime/issues/103219
if (!PlatformDetection.IsNativeAot)
{
// Making this work with native AOT tracked in https://github.com/dotnet/runtime/issues/103219
if (!PlatformDetection.IsNativeAot)
{
yield return new object[] {
(Action)og.NonGenericDefaultMethod,
nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>.NonGenericDefaultMethod) ,
TestNamespace + nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>) + "`1"
};
}
yield return new object[] {
(Action)og.GenericDefaultMethod<object>,
nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>.GenericDefaultMethod),
(Action)og.NonGenericDefaultMethod,
nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>.NonGenericDefaultMethod) ,
TestNamespace + nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>) + "`1"
};
}
yield return new object[] {
(Action)og.GenericDefaultMethod<object>,
nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>.GenericDefaultMethod),
TestNamespace + nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>) + "`1"
};
yield return new object[] {
(Action)og.NonGenericMethod,
TestNamespace + nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>) + "<T>." + nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>.NonGenericMethod),
Expand Down

0 comments on commit d46fdc1

Please sign in to comment.