diff --git a/src/Neo.Compiler.CSharp/MethodConvert.cs b/src/Neo.Compiler.CSharp/MethodConvert.cs index e189ea9f7..c68b46c20 100644 --- a/src/Neo.Compiler.CSharp/MethodConvert.cs +++ b/src/Neo.Compiler.CSharp/MethodConvert.cs @@ -2849,7 +2849,7 @@ private void ConvertElementAccessPostIncrementOrDecrementExpression(SemanticMode AddInstruction(OpCode.DUP); AddInstruction(OpCode.REVERSE4); AddInstruction(OpCode.REVERSE3); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, property.Type); Call(model, property.SetMethod!, CallingConvention.StdCall); } else @@ -2862,7 +2862,7 @@ private void ConvertElementAccessPostIncrementOrDecrementExpression(SemanticMode AddInstruction(OpCode.DUP); AddInstruction(OpCode.REVERSE4); AddInstruction(OpCode.REVERSE3); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, model.GetTypeInfo(operand).Type); AddInstruction(OpCode.SETITEM); } } @@ -2896,7 +2896,7 @@ private void ConvertFieldIdentifierNamePostIncrementOrDecrementExpression(Syntax byte index = context.AddStaticField(symbol); AccessSlot(OpCode.LDSFLD, index); AddInstruction(OpCode.DUP); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AccessSlot(OpCode.STSFLD, index); } else @@ -2907,7 +2907,7 @@ private void ConvertFieldIdentifierNamePostIncrementOrDecrementExpression(Syntax Push(index); AddInstruction(OpCode.PICKITEM); AddInstruction(OpCode.TUCK); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); Push(index); AddInstruction(OpCode.SWAP); AddInstruction(OpCode.SETITEM); @@ -2919,7 +2919,7 @@ private void ConvertLocalIdentifierNamePostIncrementOrDecrementExpression(Syntax byte index = _localVariables[symbol]; AccessSlot(OpCode.LDLOC, index); AddInstruction(OpCode.DUP); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AccessSlot(OpCode.STLOC, index); } @@ -2928,7 +2928,7 @@ private void ConvertParameterIdentifierNamePostIncrementOrDecrementExpression(Sy byte index = _parameters[symbol]; AccessSlot(OpCode.LDARG, index); AddInstruction(OpCode.DUP); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AccessSlot(OpCode.STARG, index); } @@ -2938,7 +2938,7 @@ private void ConvertPropertyIdentifierNamePostIncrementOrDecrementExpression(Sem { Call(model, symbol.GetMethod!); AddInstruction(OpCode.DUP); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); Call(model, symbol.SetMethod!); } else @@ -2947,7 +2947,7 @@ private void ConvertPropertyIdentifierNamePostIncrementOrDecrementExpression(Sem AddInstruction(OpCode.DUP); Call(model, symbol.GetMethod!); AddInstruction(OpCode.TUCK); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); Call(model, symbol.SetMethod!, CallingConvention.StdCall); } } @@ -2975,7 +2975,7 @@ private void ConvertFieldMemberAccessPostIncrementOrDecrementExpression(Semantic byte index = context.AddStaticField(symbol); AccessSlot(OpCode.LDSFLD, index); AddInstruction(OpCode.DUP); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AccessSlot(OpCode.STSFLD, index); } else @@ -2986,7 +2986,7 @@ private void ConvertFieldMemberAccessPostIncrementOrDecrementExpression(Semantic Push(index); AddInstruction(OpCode.PICKITEM); AddInstruction(OpCode.TUCK); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); Push(index); AddInstruction(OpCode.SWAP); AddInstruction(OpCode.SETITEM); @@ -2999,7 +2999,7 @@ private void ConvertPropertyMemberAccessPostIncrementOrDecrementExpression(Seman { Call(model, symbol.GetMethod!); AddInstruction(OpCode.DUP); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); Call(model, symbol.SetMethod!); } else @@ -3008,7 +3008,7 @@ private void ConvertPropertyMemberAccessPostIncrementOrDecrementExpression(Seman AddInstruction(OpCode.DUP); Call(model, symbol.GetMethod!); AddInstruction(OpCode.TUCK); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); Call(model, symbol.SetMethod!, CallingConvention.StdCall); } } @@ -3076,7 +3076,7 @@ private void ConvertElementAccessPreIncrementOrDecrementExpression(SemanticModel AddInstruction(OpCode.OVER); AddInstruction(OpCode.OVER); Call(model, property.GetMethod!, CallingConvention.StdCall); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, property.Type); AddInstruction(OpCode.DUP); AddInstruction(OpCode.REVERSE4); Call(model, property.SetMethod!, CallingConvention.Cdecl); @@ -3088,7 +3088,7 @@ private void ConvertElementAccessPreIncrementOrDecrementExpression(SemanticModel AddInstruction(OpCode.OVER); AddInstruction(OpCode.OVER); AddInstruction(OpCode.PICKITEM); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, model.GetTypeInfo(operand).Type); AddInstruction(OpCode.DUP); AddInstruction(OpCode.REVERSE4); AddInstruction(OpCode.REVERSE3); @@ -3124,7 +3124,7 @@ private void ConvertFieldIdentifierNamePreIncrementOrDecrementExpression(SyntaxT { byte index = context.AddStaticField(symbol); AccessSlot(OpCode.LDSFLD, index); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AddInstruction(OpCode.DUP); AccessSlot(OpCode.STSFLD, index); } @@ -3135,7 +3135,7 @@ private void ConvertFieldIdentifierNamePreIncrementOrDecrementExpression(SyntaxT AddInstruction(OpCode.DUP); Push(index); AddInstruction(OpCode.PICKITEM); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AddInstruction(OpCode.TUCK); Push(index); AddInstruction(OpCode.SWAP); @@ -3147,7 +3147,7 @@ private void ConvertLocalIdentifierNamePreIncrementOrDecrementExpression(SyntaxT { byte index = _localVariables[symbol]; AccessSlot(OpCode.LDLOC, index); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AddInstruction(OpCode.DUP); AccessSlot(OpCode.STLOC, index); } @@ -3156,7 +3156,7 @@ private void ConvertParameterIdentifierNamePreIncrementOrDecrementExpression(Syn { byte index = _parameters[symbol]; AccessSlot(OpCode.LDARG, index); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AddInstruction(OpCode.DUP); AccessSlot(OpCode.STARG, index); } @@ -3166,7 +3166,7 @@ private void ConvertPropertyIdentifierNamePreIncrementOrDecrementExpression(Sema if (symbol.IsStatic) { Call(model, symbol.GetMethod!); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AddInstruction(OpCode.DUP); Call(model, symbol.SetMethod!); } @@ -3175,7 +3175,7 @@ private void ConvertPropertyIdentifierNamePreIncrementOrDecrementExpression(Sema AddInstruction(OpCode.LDARG0); AddInstruction(OpCode.DUP); Call(model, symbol.GetMethod!); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AddInstruction(OpCode.TUCK); Call(model, symbol.SetMethod!, CallingConvention.StdCall); } @@ -3203,7 +3203,7 @@ private void ConvertFieldMemberAccessPreIncrementOrDecrementExpression(SemanticM { byte index = context.AddStaticField(symbol); AccessSlot(OpCode.LDSFLD, index); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AddInstruction(OpCode.DUP); AccessSlot(OpCode.STSFLD, index); } @@ -3214,7 +3214,7 @@ private void ConvertFieldMemberAccessPreIncrementOrDecrementExpression(SemanticM AddInstruction(OpCode.DUP); Push(index); AddInstruction(OpCode.PICKITEM); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AddInstruction(OpCode.TUCK); Push(index); AddInstruction(OpCode.SWAP); @@ -3227,7 +3227,7 @@ private void ConvertPropertyMemberAccessPreIncrementOrDecrementExpression(Semant if (symbol.IsStatic) { Call(model, symbol.GetMethod!); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AddInstruction(OpCode.DUP); Call(model, symbol.SetMethod!); } @@ -3236,13 +3236,13 @@ private void ConvertPropertyMemberAccessPreIncrementOrDecrementExpression(Semant ConvertExpression(model, operand.Expression); AddInstruction(OpCode.DUP); Call(model, symbol.GetMethod!); - EmitIncrementOrDecrement(operatorToken); + EmitIncrementOrDecrement(operatorToken, symbol.Type); AddInstruction(OpCode.TUCK); Call(model, symbol.SetMethod!, CallingConvention.StdCall); } } - private void EmitIncrementOrDecrement(SyntaxToken operatorToken) + private void EmitIncrementOrDecrement(SyntaxToken operatorToken, ITypeSymbol? typeSymbol) { AddInstruction(operatorToken.ValueText switch { @@ -3250,6 +3250,7 @@ private void EmitIncrementOrDecrement(SyntaxToken operatorToken) "--" => OpCode.DEC, _ => throw new CompilationException(operatorToken, DiagnosticId.SyntaxNotSupported, $"Unsupported operator: {operatorToken}") }); + if (typeSymbol != null) EnsureIntegerInRange(typeSymbol); } private void ConvertSwitchExpression(SemanticModel model, SwitchExpressionSyntax expression) diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestClasses/Contract_Inc_Dec.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestClasses/Contract_Inc_Dec.cs new file mode 100644 index 000000000..77f39387d --- /dev/null +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestClasses/Contract_Inc_Dec.cs @@ -0,0 +1,282 @@ +using System; +using System.ComponentModel; + +namespace Neo.Compiler.CSharp.UnitTests.TestClasses +{ + public class Contract2_Inc_Dec : SmartContract.Framework.SmartContract + { + private static uint _property; + private static int _intProperty; + + public static uint UnitTest_Property_Inc_Checked() + { + _property = uint.MaxValue; + checked + { + ++_property; + _property++; + } + return _property; + } + + public static uint UnitTest_Property_Inc_UnChecked() + { + _property = uint.MaxValue; + unchecked + { + ++_property; + _property++; + } + return _property; + } + + public static uint UnitTest_Property_Dec_Checked() + { + _property = uint.MinValue; + checked + { + --_property; + _property--; + } + return _property; + } + + public static uint UnitTest_Property_Dec_UnChecked() + { + _property = uint.MinValue; + unchecked + { + --_property; + _property--; + } + return _property; + } + + public static uint UnitTest_Local_Dec_Checked() + { + uint local = uint.MinValue; + checked + { + --local; + local--; + } + return local; + } + + public static uint UnitTest_Local_Dec_UnChecked() + { + uint local = uint.MinValue; + unchecked + { + --local; + local--; + } + return local; + } + + public static uint UnitTest_Local_Inc_Checked() + { + uint local = uint.MaxValue; + checked + { + ++local; + local++; + } + return local; + } + + public static uint UnitTest_Local_Inc_UnChecked() + { + uint local = uint.MaxValue; + unchecked + { + ++local; + local++; + } + return local; + } + + public static uint UnitTest_Param_Dec_Checked(uint param) + { + param = uint.MinValue; + checked + { + --param; + param--; + } + return param; + } + + public static uint UnitTest_Param_Dec_UnChecked(uint param) + { + param = uint.MinValue; + unchecked + { + --param; + param--; + } + return param; + } + + public static uint UnitTest_Param_Inc_Checked(uint param) + { + param = uint.MaxValue; + checked + { + ++param; + param++; + } + return param; + } + + public static uint UnitTest_Param_Inc_UnChecked(uint param) + { + param = uint.MaxValue; + unchecked + { + ++param; + param++; + } + return param; + } + + public static int UnitTest_Property_Inc_Checked_Int() + { + _intProperty = int.MaxValue; + checked + { + ++_intProperty; + _intProperty++; + } + return _intProperty; + } + + public static int UnitTest_Property_Inc_UnChecked_Int() + { + _intProperty = int.MaxValue; + unchecked + { + ++_intProperty; + _intProperty++; + } + return _intProperty; + } + + public static int UnitTest_Property_Dec_Checked_Int() + { + _intProperty = int.MinValue; + checked + { + --_intProperty; + _intProperty--; + } + return _intProperty; + } + + public static int UnitTest_Property_Dec_UnChecked_Int() + { + _intProperty = int.MinValue; + unchecked + { + --_intProperty; + _intProperty--; + } + return _intProperty; + } + + // Local Variable Tests + public static int UnitTest_Local_Inc_Checked_Int() + { + int local = int.MaxValue; + checked + { + ++local; + local++; + } + return local; + } + + public static int UnitTest_Local_Inc_UnChecked_Int() + { + int local = int.MaxValue; + unchecked + { + ++local; + local++; + } + return local; + } + + public static int UnitTest_Local_Dec_Checked_Int() + { + int local = int.MinValue; + checked + { + --local; + local--; + } + return local; + } + + public static int UnitTest_Local_Dec_UnChecked_Int() + { + int local = int.MinValue; + unchecked + { + --local; + local--; + } + return local; + } + + // Parameter Tests + public static int UnitTest_Param_Inc_Checked_Int(int param) + { + param = int.MaxValue; + checked + { + ++param; + param++; + } + return param; + } + + public static int UnitTest_Param_Inc_UnChecked_Int(int param) + { + param = int.MaxValue; + unchecked + { + ++param; + param++; + } + return param; + } + + public static int UnitTest_Param_Dec_Checked_Int(int param) + { + param = int.MinValue; + checked + { + --param; + param--; + } + return param; + } + + public static int UnitTest_Param_Dec_UnChecked_Int(int param) + { + param = int.MinValue; + unchecked + { + --param; + param--; + } + return param; + } + + public static void UnitTest_Not_DeadLoop() + { + for (uint i = 5; i < 7; i--) ; + } + } +} diff --git a/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Inc_Dec.cs b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Inc_Dec.cs new file mode 100644 index 000000000..7003cafdd --- /dev/null +++ b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Inc_Dec.cs @@ -0,0 +1,233 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Neo.Compiler.CSharp.UnitTests.Utils; +using Neo.VM; + +namespace Neo.Compiler.CSharp.UnitTests +{ + [TestClass] + public class UnitTest_Inc_Dec + { + private TestEngine _engine; + + [TestInitialize] + public void Init() + { + _engine = new TestEngine(); + _engine.AddEntryScript("./TestClasses/Contract_Inc_Dec.cs"); + } + + [TestMethod] + public void Test_Property_Inc_Checked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Property_Inc_Checked"); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_Property_Inc_UnChecked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Property_Inc_UnChecked"); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(uint.MaxValue + 2), result.Pop().GetInteger()); + } + + [TestMethod] + public void Test_Property_Dec_Checked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Property_Dec_Checked"); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_Property_Dec_UnChecked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Property_Dec_UnChecked"); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(uint.MinValue - 2), result.Pop().GetInteger()); + } + + [TestMethod] + public void Test_Local_Inc_Checked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Local_Inc_Checked"); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_Local_Inc_UnChecked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Local_Inc_UnChecked"); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(uint.MaxValue + 2), result.Pop().GetInteger()); + } + + [TestMethod] + public void Test_Local_Dec_Checked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Local_Dec_Checked"); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_Local_Dec_UnChecked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Local_Dec_UnChecked"); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(uint.MinValue - 2), result.Pop().GetInteger()); + } + [TestMethod] + public void Test_Param_Inc_Checked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Param_Inc_Checked", 0); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_Param_Inc_UnChecked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Param_Inc_UnChecked", 0); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(uint.MaxValue + 2), result.Pop().GetInteger()); + } + + [TestMethod] + public void Test_Param_Dec_Checked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Param_Dec_Checked", 0); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_Param_Dec_UnChecked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Param_Dec_UnChecked", 0); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(uint.MinValue - 2), result.Pop().GetInteger()); + } + + // Test Methods for int type + [TestMethod] + public void Test_IntProperty_Inc_Checked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Property_Inc_Checked_Int"); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_IntProperty_Inc_UnChecked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Property_Inc_UnChecked_Int"); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(int.MaxValue + 2), result.Pop().GetInteger()); + } + + [TestMethod] + public void Test_IntProperty_Dec_Checked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Property_Dec_Checked_Int"); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_IntProperty_Dec_UnChecked() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Property_Dec_UnChecked_Int"); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(int.MinValue - 2), result.Pop().GetInteger()); + } + + // Local Variable Tests for int + [TestMethod] + public void Test_Local_Inc_Checked_Int() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Local_Inc_Checked_Int"); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_Local_Inc_UnChecked_Int() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Local_Inc_UnChecked_Int"); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(int.MaxValue + 2), result.Pop().GetInteger()); + } + + [TestMethod] + public void Test_Local_Dec_Checked_Int() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Local_Dec_Checked_Int"); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_Local_Dec_UnChecked_Int() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Local_Dec_UnChecked_Int"); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(int.MinValue - 2), result.Pop().GetInteger()); + } + + // Parameter Tests for int + [TestMethod] + public void Test_Param_Inc_Checked_Int() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Param_Inc_Checked_Int", 0); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_Param_Inc_UnChecked_Int() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Param_Inc_UnChecked_Int", 0); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(int.MaxValue + 2), result.Pop().GetInteger()); + } + + [TestMethod] + public void Test_Param_Dec_Checked_Int() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Param_Dec_Checked_Int", 0); + Assert.AreEqual(VMState.FAULT, _engine.State); + } + + [TestMethod] + public void Test_Param_Dec_UnChecked_Int() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Param_Dec_UnChecked_Int", 0); + Assert.AreEqual(VMState.HALT, _engine.State); + Assert.AreEqual(unchecked(int.MinValue - 2), result.Pop().GetInteger()); + } + + [TestMethod] + public void Test_Not_DeadLoop() + { + _engine.Reset(); + var result = _engine.ExecuteTestCaseStandard("unitTest_Not_DeadLoop"); + Assert.AreEqual(VMState.HALT, _engine.State); + } + } +}