Fix bug in generating termination checks in compound statement for loop.
Add regression test for this case.0.7.4-extended
parent
b6daf4d4c6
commit
d01943fa40
|
@ -445,7 +445,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
if (previousSymbol is GlobalFunctionDefinition
|
if (previousSymbol is GlobalFunctionDefinition
|
||||||
|| previousSymbol is WhileStatement
|
|| previousSymbol is WhileStatement
|
||||||
|| previousSymbol is DoWhileStatement
|
|| previousSymbol is DoWhileStatement
|
||||||
|| previousSymbol is ForLoopStatement
|
|| previousSymbol is ForLoop
|
||||||
|| previousSymbol is StateEvent)
|
|| previousSymbol is StateEvent)
|
||||||
retstr += GenerateIndentedLine(m_coopTerminationCheck);
|
retstr += GenerateIndentedLine(m_coopTerminationCheck);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,12 +76,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests
|
||||||
xEngineConfig.Set("AppDomainLoading", "false");
|
xEngineConfig.Set("AppDomainLoading", "false");
|
||||||
|
|
||||||
xEngineConfig.Set("ScriptStopStrategy", "co-op");
|
xEngineConfig.Set("ScriptStopStrategy", "co-op");
|
||||||
|
xEngineConfig.Set("WriteScriptSourceToDebugFile", true);
|
||||||
|
|
||||||
// This is not currently used at all for co-op termination. Bumping up to demonstrate that co-op termination
|
// This is not currently used at all for co-op termination. Bumping up to demonstrate that co-op termination
|
||||||
// has an effect - without it tests will fail due to a 120 second wait for the event to finish.
|
// has an effect - without it tests will fail due to a 120 second wait for the event to finish.
|
||||||
xEngineConfig.Set("WaitForEventCompletionOnScriptStop", 120000);
|
xEngineConfig.Set("WaitForEventCompletionOnScriptStop", 120000);
|
||||||
|
|
||||||
m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource);
|
m_scene = new SceneHelpers().SetupScene("My Test", TestHelpers.ParseTail(0x9999), 1000, 1000, configSource);
|
||||||
SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine);
|
SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine);
|
||||||
m_scene.StartScripts();
|
m_scene.StartScripts();
|
||||||
}
|
}
|
||||||
|
@ -113,7 +114,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestStopOnLongForLoop()
|
public void TestStopOnLongSingleStatementForLoop()
|
||||||
{
|
{
|
||||||
TestHelpers.InMethod();
|
TestHelpers.InMethod();
|
||||||
// TestHelpers.EnableLogging();
|
// TestHelpers.EnableLogging();
|
||||||
|
@ -133,6 +134,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests
|
||||||
TestStop(script);
|
TestStop(script);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestStopOnLongCompoundStatementForLoop()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
// TestHelpers.EnableLogging();
|
||||||
|
|
||||||
|
string script =
|
||||||
|
@"default
|
||||||
|
{
|
||||||
|
state_entry()
|
||||||
|
{
|
||||||
|
llSay(0, ""Thin Lizzy"");
|
||||||
|
integer i = 0;
|
||||||
|
for (i = 0; i < 2147483647; i++)
|
||||||
|
{
|
||||||
|
llSay(0, ""Iter "" + (string)i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}";
|
||||||
|
|
||||||
|
TestStop(script);
|
||||||
|
}
|
||||||
|
|
||||||
private void TestStop(string script)
|
private void TestStop(string script)
|
||||||
{
|
{
|
||||||
UUID userId = TestHelpers.ParseTail(0x1);
|
UUID userId = TestHelpers.ParseTail(0x1);
|
||||||
|
|
Loading…
Reference in New Issue