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 argumentslink-sitting
parent
d728c1beb2
commit
62006baaef
|
@ -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
Loading…
Reference in New Issue