Skip to content

Commit

Permalink
Updates MonoMod.Common to 20.2.1.1; new try on failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Feb 2, 2020
1 parent c802c66 commit 8de325b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
15 changes: 6 additions & 9 deletions Harmony/Harmony.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@
<ItemGroup>
<!-- Reference assemblies are needed for non-Windows .NET Framework targeting builds. -->
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.0" PrivateAssets="All" Condition="'$(TargetFramework)'=='net35'" />
<PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" PrivateAssets="all" Condition="'$(TargetFramework)'=='net35'">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ILRepack.MSBuild.Task" Version="2.0.13" PrivateAssets="All" />
</ItemGroup>

Expand All @@ -93,7 +95,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MonoMod.Common" Version="20.1.25.7" PrivateAssets="All" />
<!-- https://dev.azure.com/MonoMod/MonoMod/_packaging?_a=feed&feed=DevBuilds -->
<PackageReference Include="MonoMod.Common" Version="20.2.1.1" PrivateAssets="All" />
<PackageReference Include="ILRepack.MSBuild.Task" Version="2.0.13" PrivateAssets="All" />
</ItemGroup>

Expand All @@ -110,13 +113,7 @@
<InternalizeExcludeAssemblies Include="Harmony" />
</ItemGroup>

<ILRepack
OutputType="$(OutputType)"
MainAssembly="$(AssemblyName).dll"
OutputAssembly="$(AssemblyName).dll"
InputAssemblies="@(InputAssemblies)"
InternalizeExcludeAssemblies="@(InternalizeExcludeAssemblies)"
WorkingDirectory="$(WorkingDirectory)" />
<ILRepack OutputType="$(OutputType)" MainAssembly="$(AssemblyName).dll" OutputAssembly="$(AssemblyName).dll" InputAssemblies="@(InputAssemblies)" InternalizeExcludeAssemblies="@(InternalizeExcludeAssemblies)" WorkingDirectory="$(WorkingDirectory)" />
</Target>

</Project>
2 changes: 1 addition & 1 deletion HarmonyTests/HarmonyTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MonoMod.Common" Version="20.1.25.7" PrivateAssets="All" />
<PackageReference Include="MonoMod.Common" Version="20.2.1.1" PrivateAssets="All" />
</ItemGroup>

<Target Name="ChangeAliasesOfStrongNameAssemblies" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
Expand Down
6 changes: 4 additions & 2 deletions HarmonyTests/Patching/Assets/FinalizerPatchClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ public string Method()
}
}


public class ThrowingStringReturningMethod
{
[MethodImpl(MethodImplOptions.NoInlining)]
public string Method()
{
if (this != null) // satisfy compiler
throw new OriginalException();
throw new OriginalException();
#pragma warning disable CS0162
return "OriginalResult";
#pragma warning restore CS0162
}
}

Expand Down
8 changes: 3 additions & 5 deletions HarmonyTests/Patching/FinalizerPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public void SetUp()
if (m_method.ReturnType == typeof(void))
_ = m_method.Invoke(obj, null);
else
info["result"] = m_method.Invoke(obj, null);
info["result"] = m_method.Invoke(obj, new object[0]);
info["outerexception"] = null;
}
catch (TargetInvocationException e)
Expand All @@ -234,10 +234,8 @@ private void AssertGotResult(string str)
private void AssertGotNullResult()
{
Assert.NotNull(info, "info should not be null");
if (info.TryGetValue("result", out var value))
Assert.IsNull(value, "Result should be null");
else
Assert.Fail("Should return result");
Assert.True(info.ContainsKey("result"), "Should return result");
Assert.IsNull(info["result"], "Result should be null");
}

private void AssertGotNoResult()
Expand Down

0 comments on commit 8de325b

Please sign in to comment.