Added .NET Core 3.1 target to test projects

このコミットが含まれているのは:
Sergio Pedri committed 2021-11-16 17:34:01 +01:00
1 親 06ce524740
コミット 1e4b547c38
7ファイル変更
+22 -9

検索条件に一致するファイルはありません

+2 -1
ファイルの表示
@@ -14,7 +14,8 @@ internal static class DictionaryExtensions
/// <param name="key">The lookup key to use.</param>
/// <param name="value">The resulting item, if present.</param>
/// <returns>Whether or not an item was found with the given key.</returns>
public static bool Remove<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, TKey key, out TValue value)
public static bool Remove<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, TKey key, out TValue? value)
where TKey : notnull
{
if (dictionary.TryGetValue(key, out value))
{
+1 -1
ファイルの表示
@@ -14,6 +14,6 @@ internal static class Enum
public static string GetName<T>(T value)
where T : unmanaged, global::System.Enum
{
return global::System.Enum.GetName(typeof(T), value);
return global::System.Enum.GetName(typeof(T), value)!;
}
}
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
+2 -2
ファイルの表示
@@ -226,7 +226,7 @@ public partial class DebugViewTests
{
for (int j = 0; j < width; j++)
{
data[i, j] = random.NextSingle();
data[i, j] = (float)random.NextDouble();
}
}
@@ -279,7 +279,7 @@ public partial class DebugViewTests
{
for (int j = 0; j < width; j++)
{
data[k, i, j] = random.NextSingle();
data[k, i, j] = (float)random.NextDouble();
}
}
}
+1 -1
ファイルの表示
@@ -25,7 +25,7 @@ public sealed class CombinatorialTestMethodAttribute : TestMethodAttribute, ITes
if (methodInfo.GetCustomAttribute<AllDevicesAttribute>() is not null)
{
devices = Enum.GetValues<Device>();
devices = (Device[])Enum.GetValues(typeof(Device));
}
else if (methodInfo.GetCustomAttributes<DeviceAttribute>().ToArray() is { Length: > 0 } values)
{
+13 -1
ファイルの表示
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
@@ -21,6 +21,18 @@
PrivateAssets="contentfiles;build"/>
</ItemGroup>
<!-- When the .NET Standard 2.0 version of ComputeSharp is resolved, the TerraFX APIs are internal, as they
are referenced from the shared project. The same reference is needed here to make all tests build fine. -->
<Import Condition="'$(TargetFramework)' == 'netcoreapp3.1'"
Project="..\..\src\TerraFX.Interop.Windows\TerraFX.Interop.Windows.projitems" />
<Import Condition="'$(TargetFramework)' == 'netcoreapp3.1'"
Project="..\..\src\ComputeSharp.NetStandard\ComputeSharp.NetStandard.projitems" />
<!-- Only when the local TerraFX is referenced, ignore warnings from there -->
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<NoWarn>$(NoWarn);CS0649</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\samples\ComputeSharp.ImageProcessing\Primitives\Complex64.cs" Link="Imaging\Primitives\Complex64.cs" />
<Compile Include="..\..\samples\ComputeSharp.ImageProcessing\Processors\HlslBokehBlurProcessor.cs" Link="Imaging\Processors\HlslBokehBlurProcessor.cs" />
+2 -2
ファイルの表示
@@ -152,7 +152,7 @@ public class ShadersTests
using (ReadWriteTexture2D<Rgba32, float4> texture = device.Get().AllocateReadWriteTexture2D<Rgba32, float4>(imageInfo.Width, imageInfo.Height))
{
if (shaderType.IsAssignableTo(typeof(IComputeShader)))
if (typeof(IComputeShader).IsAssignableFrom(shaderType))
{
static void RunComputeShader<T>(ReadWriteTexture2D<Rgba32, float4> texture)
where T : struct, IComputeShader
@@ -219,7 +219,7 @@ public class ShadersTests
using (ReadWriteTexture2D<Rgba32, float4> texture = device.Get().AllocateReadWriteTexture2D<Rgba32, float4>(imageInfo.Width, imageInfo.Height))
{
if (shaderType.IsAssignableTo(typeof(IComputeShader)))
if (typeof(IComputeShader).IsAssignableFrom(shaderType))
{
Assert.AreEqual(typeof(TCompute), shaderType);