Make state_exit, moving_end, moving_start, not_at_rot_target, not_at_target and timer LSL events generate a syntax error if inappropriately given arguments.

This matches behaviour seen on the LL grid and a previous change for state_entry.
These are all the events which should take no arguments
link-sitting
Justin Clark-Casey (justincc) 2013-11-16 01:30:23 +00:00
parent d728c1beb2
commit 62006baaef
2 changed files with 7850 additions and 7777 deletions

View File

@ -38,6 +38,46 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
{
CSCodeGenerator m_cg = new CSCodeGenerator();
[Test]
public void TestMovingEndEvent()
{
TestHelpers.InMethod();
// TestHelpers.EnableLogging();
TestCompile("default { moving_end() {} }", false);
TestCompile("default { moving_end(integer n) {} }", true);
}
[Test]
public void TestMovingStartEvent()
{
TestHelpers.InMethod();
// TestHelpers.EnableLogging();
TestCompile("default { moving_start() {} }", false);
TestCompile("default { moving_start(integer n) {} }", true);
}
[Test]
public void TestNotAtRotTargetEvent()
{
TestHelpers.InMethod();
// TestHelpers.EnableLogging();
TestCompile("default { not_at_rot_target() {} }", false);
TestCompile("default { not_at_rot_target(integer n) {} }", true);
}
[Test]
public void TestNotAtTargetEvent()
{
TestHelpers.InMethod();
// TestHelpers.EnableLogging();
TestCompile("default { not_at_target() {} }", false);
TestCompile("default { not_at_target(integer n) {} }", true);
}
[Test]
public void TestStateEntryEvent()
{
@ -48,6 +88,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
TestCompile("default { state_entry(integer n) {} }", true);
}
[Test]
public void TestStateExitEvent()
{
TestHelpers.InMethod();
// TestHelpers.EnableLogging();
TestCompile("default { state_exit() {} }", false);
TestCompile("default { state_exit(integer n) {} }", true);
}
[Test]
public void TestTimerEvent()
{
TestHelpers.InMethod();
// TestHelpers.EnableLogging();
TestCompile("default { timer() {} }", false);
TestCompile("default { timer(integer n) {} }", true);
}
private void TestCompile(string script, bool expectException)
{
bool gotException = false;

File diff suppressed because it is too large Load Diff