Added test for new exception

このコミットが含まれているのは:
Sergio Pedri committed 2019-09-06 21:53:44 +02:00
1 親 fc9c61ca6a
コミット 10e35c4991
1ファイル変更
+15
+15
ファイルの表示
@@ -1,4 +1,7 @@
using System;
using System.Linq;
using ComputeSharp.Exceptions;
using ComputeSharp.Graphics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ComputeSharp.Tests
@@ -14,6 +17,18 @@ namespace ComputeSharp.Tests
Assert.ThrowsException<InvalidOperationException>(() => Gpu.Default.For(10, action));
}
[TestMethod]
public void DeviceMismatchException()
{
ReadWriteBuffer<int> buffer = Gpu.Default.AllocateReadWriteBuffer<int>(1);
GraphicsDevice device = Gpu.EnumerateDevices().First();
Action<ThreadIds> action = id => buffer[0] = 1;
Assert.ThrowsException<GraphicsDeviceMismatchException>(() => device.For(1, action));
}
}
}