Added tests for static methods with out parameters

このコミットが含まれているのは:
Sergio Pedri committed 2019-09-04 23:22:02 +02:00
1 親 673522fda1
コミット 3984550a16
1ファイル変更
+16 -2
@@ -17,11 +17,13 @@ namespace ComputeSharp.Tests
[Pure]
public static int Sum(Float4 x) => (int)(x.X + x.Y + x.Z + x.W);
public static void Assign(int x, out int y) => y = x;
}
[TestClass]
[TestCategory("StaticMethodTests")]
public class StaticMethodTests
[TestCategory("StaticMethodsTests")]
public class StaticMethodsTests
{
[TestMethod]
public void FloatToFloatFunc()
@@ -61,6 +63,18 @@ namespace ComputeSharp.Tests
Assert.IsTrue(result[0] == 20);
}
[TestMethod]
public void IntToOutIntFunc()
{
using ReadWriteBuffer<int> buffer = Gpu.Default.AllocateReadWriteBuffer<int>(1);
Gpu.Default.For(1, id => StaticMethodsContainer.Assign(7, out buffer[0]));
int[] result = buffer.GetData();
Assert.IsTrue(result[0] == 7);
}
}
}