Skip to content

Commit

Permalink
Fix simantics infinite loop unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyDuchess committed Jun 28, 2024
1 parent aa50501 commit f9ac5cb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Assets/Tests/OpenTS2/SimAntics/SimAnticsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ public void TestBHAVThrowsOnInfiniteLoop()
var stackFrame = new VMStackFrame(bhav, entity.MainThread);
entity.MainThread.Frames.Push(stackFrame);

Assert.Throws<SimAnticsException>(() =>
Exception exception = null;
vm.ExceptionHandler += (Exception e, VMEntity ent) =>
{
vm.Tick();
});
exception = e;
};

vm.Tick();

Assert.IsInstanceOf<SimAnticsException>(exception);
}
}

0 comments on commit f9ac5cb

Please sign in to comment.