Fixed internal unit tests

このコミットが含まれているのは:
Sergio Pedri committed 2020-11-30 01:25:26 +01:00
1 親 3f87743427
コミット 625a9d05f0
4ファイル変更
+36 -161

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

+2 -18
ファイルの表示
@@ -13,24 +13,8 @@ namespace ComputeSharp.Tests.Internals
{
Func<int, int> square = DynamicMethod<Func<int, int>>.New(il =>
{
il.Emit(OpCodes.Ldarg_1);
il.Emit(OpCodes.Dup);
il.Emit(OpCodes.Mul);
il.Emit(OpCodes.Ret);
});
int result = square(2); // result = 2 * 2
Assert.IsTrue(result == 4);
}
public delegate int Square(int x);
[TestMethod]
public void TestSquare()
{
Square square = DynamicMethod<Square>.New(il =>
{
// Due to the instance method trick, the first parameter is at offset 1.
// See the docs on DynamicMethod<T>.New for more info on how this works.
il.Emit(OpCodes.Ldarg_1);
il.Emit(OpCodes.Dup);
il.Emit(OpCodes.Mul);