Retarget main test project to `net48` to match EmuHawk
I swear the test runner didn't use to pick up Mono, otherwise I wouldn't have gone for .NET Core, but clearly it does now
This commit is contained in:
parent
4dadbbe42e
commit
afc181c40b
|
@ -1,9 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net48</TargetFramework>
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(APPVEYOR)' != '' ">
|
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="../TestProjects.props" />
|
<Import Project="../TestProjects.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
|
@ -8,6 +8,32 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
|
||||||
namespace BizHawk.Tests.Client.Common.Movie
|
namespace BizHawk.Tests.Client.Common.Movie
|
||||||
{
|
{
|
||||||
|
#if !(NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER)
|
||||||
|
internal static class Extensions
|
||||||
|
{
|
||||||
|
public static void NextBytes(this Random rng, Span<byte> buf)
|
||||||
|
{
|
||||||
|
var a = buf.ToArray();
|
||||||
|
rng.NextBytes(a);
|
||||||
|
a.CopyTo(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Read(this BinaryReader br, Span<byte> buf)
|
||||||
|
{
|
||||||
|
var a = buf.ToArray();
|
||||||
|
var result = br.Read(a, index: 0, count: a.Length);
|
||||||
|
a.CopyTo(buf);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Write(this BinaryWriter bw, ReadOnlySpan<byte> buf)
|
||||||
|
=> bw.Write(buf.ToArray());
|
||||||
|
|
||||||
|
public static void Write(this Stream stream, ReadOnlySpan<byte> buf)
|
||||||
|
=> stream.Write(buf.ToArray(), offset: 0, count: buf.Length);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class ZwinderStateManagerTests
|
public class ZwinderStateManagerTests
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
using BizHawk.Client.Common;
|
using BizHawk.Client.Common;
|
||||||
|
using BizHawk.Common;
|
||||||
using BizHawk.Emulation.Cores;
|
using BizHawk.Emulation.Cores;
|
||||||
|
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
@ -27,7 +28,9 @@ namespace BizHawk.Tests.Client.Common.config
|
||||||
{
|
{
|
||||||
Assert.IsTrue(
|
Assert.IsTrue(
|
||||||
appliesTo.Any(multiCoreSystems.Contains),
|
appliesTo.Any(multiCoreSystems.Contains),
|
||||||
$"core picker has submenu for {appliesTo[0]} ({string.Join('/', appliesTo)}), but {(appliesTo.Length == 1 ? "that system doesn't have" : "none of those systems have")} alternate cores");
|
appliesTo.Length is 1
|
||||||
|
? $"core picker has submenu for {appliesTo[0]}, but that system doesn't have alternate cores"
|
||||||
|
: $"core picker has submenu for {appliesTo[0]} ({string.Join("/", appliesTo)}), but none of those systems have alternate cores");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
using BizHawk.Client.Common;
|
using BizHawk.Client.Common;
|
||||||
|
using BizHawk.Common;
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
Loading…
Reference in New Issue