Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,6 @@ namespace System.Runtime.Loader.Tests

public partial class AssemblyLoadContextTest
{
class DelegateMarshallingTest : TestBase
{
[MethodImpl(MethodImplOptions.NoInlining)]
public void Execute()
{
// Delegate marshaling for types within collectible assemblies is not supported.
Assert.Throws<NotSupportedException>(() =>
{
MethodInfo methodReference = _testClassTypes[0].GetMethod("TestDelegateMarshalling");
Assert.NotNull(methodReference);
methodReference.Invoke(null, BindingFlags.DoNotWrapExceptions, Type.DefaultBinder, null, null);
});
}
}

[Fact]
public static void Unsupported_DelegateMarshalling()
{
var test = new DelegateMarshallingTest();
test.CreateContextAndLoadAssembly();
test.Execute();
test.UnloadAndClearContext();
test.CheckContextUnloaded();
}


class COMInteropTest : TestBase
{
[MethodImpl(MethodImplOptions.NoInlining)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ public static void Unload_TwoCollectibleWithOneAssemblyAndOneInstanceReferencing
}

[Fact]
public static void Unsupported_ThreadStaticAndFixedAddressValueType()
public static void Unsupported_FixedAddressValueType()
{
var asmName = new AssemblyName(TestAssemblyNotSupported);
var alc = new ResourceAssemblyLoadContext(true) { LoadBy = LoadBy.Path };
Expand All @@ -440,9 +440,8 @@ public static void Unsupported_ThreadStaticAndFixedAddressValueType()
ReflectionTypeLoadException exception = Assert.Throws<ReflectionTypeLoadException>(() => asm.DefinedTypes);

// Expecting two exceptions:
// Collectible type 'System.Runtime.Loader.Tests.TestClassNotSupported_ThreadStatic' may not have Thread or Context static members
// Collectible type 'System.Runtime.Loader.Tests.TestClassNotSupported_FixedAddressValueType' has unsupported FixedAddressValueTypeAttribute applied to a field
Assert.Equal(2, exception.LoaderExceptions.Length);
Assert.Equal(1, exception.LoaderExceptions.Length);
Assert.True(exception.LoaderExceptions.All(exp => exp is TypeLoadException));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@

namespace System.Runtime.Loader.Tests
{
public class TestClassNotSupported_ThreadStatic
{
[ThreadStatic]
public static object ThisIsAThreadStatic;

public struct S<T>
{
public T Value;
}
}

public class TestClassNotSupported_FixedAddressValueType
{
public struct S<T>
Expand Down