diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs index 87951f9d54..33d217562c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs @@ -124,8 +124,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests { state_entry() { - llSay(0, ""Thin Lizzy""); integer i = 0; + llSay(0, ""Thin Lizzy""); + for (i = 0; i < 2147483647; i++) llSay(0, ""Iter "" + (string)i); } @@ -145,8 +146,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests { state_entry() { - llSay(0, ""Thin Lizzy""); integer i = 0; + llSay(0, ""Thin Lizzy""); + for (i = 0; i < 2147483647; i++) { llSay(0, ""Iter "" + (string)i); @@ -168,6 +170,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests { state_entry() { + integer i = 0; llSay(0, ""Thin Lizzy""); while (1 == 1) @@ -189,6 +192,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests { state_entry() { + integer i = 0; llSay(0, ""Thin Lizzy""); while (1 == 1) @@ -201,6 +205,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests TestStop(script); } + [Test] + public void TestStopOnLongDoWhileLoop() + { + TestHelpers.InMethod(); +// TestHelpers.EnableLogging(); + + string script = +@"default +{ + state_entry() + { + integer i = 0; + llSay(0, ""Thin Lizzy""); + + do + { + llSay(0, ""Iter "" + (string)i); + } while (1 == 1) + } +}"; + + TestStop(script); + } + private void TestStop(string script) { UUID userId = TestHelpers.ParseTail(0x1);