Skip to content

[mono] Use ALC and throw FileNotFound in RuntimeAssembly.InternalLoad #32933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2020
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 @@ -24,7 +24,6 @@ public void CurrentLocation_HasLocaton()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/22110", TestRuntimes.Mono)]
public void LoadFromStream_Location_IsEmpty()
{
Assembly assembly = new TestStreamLoadContext().LoadFromAssemblyName(new AssemblyName("TinyAssembly"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public static void LoadFromNativeImagePath_PartiallyQualifiedPath_ThrowsArgument
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/32436", TestRuntimes.Mono)]
public static void LoadAssemblyByPath_ValidUserAssembly()
{
var asmName = new AssemblyName(TestAssembly);
Expand All @@ -84,7 +83,6 @@ public static void LoadAssemblyByPath_ValidUserAssembly()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/32437", TestRuntimes.Mono)]
public static void LoadAssemblyByStream_ValidUserAssembly()
{
var asmName = new AssemblyName(TestAssembly);
Expand All @@ -98,7 +96,6 @@ public static void LoadAssemblyByStream_ValidUserAssembly()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/32435", TestRuntimes.Mono)]
public static void LoadFromAssemblyName_AssemblyNotFound()
{
var asmName = new AssemblyName("Non.Existing.Assembly.dll");
Expand All @@ -109,7 +106,6 @@ public static void LoadFromAssemblyName_AssemblyNotFound()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/32439", TestRuntimes.Mono)]
public static void LoadFromAssemblyName_ValidTrustedPlatformAssembly()
{
var asmName = typeof(System.Linq.Enumerable).Assembly.GetName();
Expand All @@ -126,7 +122,6 @@ public static void LoadFromAssemblyName_ValidTrustedPlatformAssembly()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/32434", TestRuntimes.Mono)]
public static void GetLoadContextTest_ValidUserAssembly()
{
var asmName = new AssemblyName(TestAssembly);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ private Assembly ResolveNullAssembly(AssemblyLoadContext sender, AssemblyName as
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/32433", TestRuntimes.Mono)]
public void LoadInDefaultContext()
{
// This will attempt to load an assembly, by path, in the Default Load context via the Resolving event
Expand Down Expand Up @@ -177,7 +176,6 @@ public void LoadInDefaultContext()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/32432", TestRuntimes.Mono)]
public static void LoadNonExistentInDefaultContext()
{
// Now, try to load an assembly that does not exist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,10 @@ public override FileStream[] GetFiles (bool getResourceModules)

internal static RuntimeAssembly InternalLoad (AssemblyName assemblyRef, ref StackCrawlMark stackMark, AssemblyLoadContext assemblyLoadContext)
{
// TODO: Use assemblyLoadContext
return (RuntimeAssembly) InternalLoad (assemblyRef.FullName, ref stackMark, IntPtr.Zero);
var assembly = (RuntimeAssembly) InternalLoad (assemblyRef.FullName, ref stackMark, assemblyLoadContext != null ? assemblyLoadContext.NativeALC : IntPtr.Zero);
if (assembly == null)
throw new FileNotFoundException (null, assemblyRef.Name);
return assembly;
}

// FIXME: Merge some of these
Expand Down