Added new test for static members in class hierarchy

このコミットが含まれているのは:
Sergio Pedri committed 2019-09-06 13:42:08 +02:00
1 親 4001c60566
コミット 8b01e4f90c
1ファイル変更
+16
+16
ファイルの表示
@@ -143,5 +143,21 @@ namespace ComputeSharp.Tests
Assert.IsTrue(MathF.Abs(result[0] - expected[0]) < 0.0001f);
Assert.IsTrue(MathF.Abs(result[1] - expected[1]) < 0.0001f);
}
public static int SomeNumber = 7;
[TestMethod]
public void StaticLocalScalarFieldAssignToBuffer()
{
using ReadWriteBuffer<int> buffer = Gpu.Default.AllocateReadWriteBuffer<int>(1);
Action<ThreadIds> action = id => buffer[0] = SomeNumber;
Gpu.Default.For(1, action);
int[] result = buffer.GetData();
Assert.IsTrue(result[0] == SomeNumber);
}
}
}