Add parameter checking for land_collision, land_collision_start and land_collision_end lsl events
Wrong number of parmeters now generates syntax error on compile, as seen on LL gridmaster-beforevarregion
parent
b8dd203378
commit
a64377149d
|
@ -215,6 +215,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
|||
TestIntArgEvent("touch_end");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLandCollisionEvent()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
TestVectorArgEvent("land_collision");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLandCollisionStartEvent()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
TestVectorArgEvent("land_collision_start");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLandCollisionEndEvent()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
TestVectorArgEvent("land_collision_end");
|
||||
}
|
||||
|
||||
|
||||
private void TestIntArgEvent(string eventName)
|
||||
{
|
||||
TestCompile("default { " + eventName + "(integer n) {} }", false);
|
||||
|
@ -223,6 +251,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
|||
TestCompile("default { " + eventName + "(integer n, integer o) {{}} }", true);
|
||||
}
|
||||
|
||||
private void TestVectorArgEvent(string eventName)
|
||||
{
|
||||
TestCompile("default { " + eventName + "(vector v) {} }", false);
|
||||
TestCompile("default { " + eventName + "{{}} }", true);
|
||||
TestCompile("default { " + eventName + "(string s) {{}} }", true);
|
||||
TestCompile("default { " + eventName + "(vector v, vector w) {{}} }", 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