From f9ac5cb8d6acc7b75c5c2c3476a4cb07512284f0 Mon Sep 17 00:00:00 2001 From: Nahuel Rocchetti Date: Fri, 28 Jun 2024 15:47:44 -0300 Subject: [PATCH] Fix simantics infinite loop unit test --- Assets/Tests/OpenTS2/SimAntics/SimAnticsTest.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Assets/Tests/OpenTS2/SimAntics/SimAnticsTest.cs b/Assets/Tests/OpenTS2/SimAntics/SimAnticsTest.cs index d9ff1646..ea81d5eb 100644 --- a/Assets/Tests/OpenTS2/SimAntics/SimAnticsTest.cs +++ b/Assets/Tests/OpenTS2/SimAntics/SimAnticsTest.cs @@ -89,9 +89,14 @@ public void TestBHAVThrowsOnInfiniteLoop() var stackFrame = new VMStackFrame(bhav, entity.MainThread); entity.MainThread.Frames.Push(stackFrame); - Assert.Throws(() => + Exception exception = null; + vm.ExceptionHandler += (Exception e, VMEntity ent) => { - vm.Tick(); - }); + exception = e; + }; + + vm.Tick(); + + Assert.IsInstanceOf(exception); } }