Add do-while co-op termination test

Minor changes to scripts in other tests.
0.7.4-extended
Justin Clark-Casey (justincc) 2013-01-22 01:53:10 +00:00
parent b43a6b0199
commit 8148d7e204
1 changed files with 30 additions and 2 deletions

View File

@ -124,8 +124,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests
{ {
state_entry() state_entry()
{ {
llSay(0, ""Thin Lizzy"");
integer i = 0; integer i = 0;
llSay(0, ""Thin Lizzy"");
for (i = 0; i < 2147483647; i++) for (i = 0; i < 2147483647; i++)
llSay(0, ""Iter "" + (string)i); llSay(0, ""Iter "" + (string)i);
} }
@ -145,8 +146,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests
{ {
state_entry() state_entry()
{ {
llSay(0, ""Thin Lizzy"");
integer i = 0; integer i = 0;
llSay(0, ""Thin Lizzy"");
for (i = 0; i < 2147483647; i++) for (i = 0; i < 2147483647; i++)
{ {
llSay(0, ""Iter "" + (string)i); llSay(0, ""Iter "" + (string)i);
@ -168,6 +170,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests
{ {
state_entry() state_entry()
{ {
integer i = 0;
llSay(0, ""Thin Lizzy""); llSay(0, ""Thin Lizzy"");
while (1 == 1) while (1 == 1)
@ -189,6 +192,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests
{ {
state_entry() state_entry()
{ {
integer i = 0;
llSay(0, ""Thin Lizzy""); llSay(0, ""Thin Lizzy"");
while (1 == 1) while (1 == 1)
@ -201,6 +205,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests
TestStop(script); 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) private void TestStop(string script)
{ {
UUID userId = TestHelpers.ParseTail(0x1); UUID userId = TestHelpers.ParseTail(0x1);