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 grid
master-beforevarregion
Justin Clark-Casey (justincc) 2013-11-29 00:44:53 +00:00
parent b8dd203378
commit a64377149d
2 changed files with 8345 additions and 7964 deletions

View File

@ -213,7 +213,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
// TestHelpers.EnableLogging();
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)
{
@ -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