From 679dc811dda95bd3d037e9bd691a9cd10fbf032a Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 22 Jan 2013 02:22:58 +0000 Subject: [PATCH] Add regression test for co-op termination on infinite user function call regression. Such a script would probably run out of stack pretty quickly anyway. --- .../Instance/Tests/CoopTerminationTests.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs index 3365c92b0b..149a27bd38 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs @@ -261,6 +261,36 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests TestStop(script); } + [Test] + public void TestStopOnInfiniteUserFunctionCallLoop() + { + TestHelpers.InMethod(); +// TestHelpers.EnableLogging(); + + string script = +@" +integer i = 0; + +ufn1() +{ + llSay(0, ""Iter ufn1() "" + (string)i++); + ufn1(); +} + +default +{ + state_entry() + { + integer i = 0; + llSay(0, ""Thin Lizzy""); + + ufn1(); + } +}"; + + TestStop(script); + } + private void TestStop(string script) { UUID userId = TestHelpers.ParseTail(0x1);