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

@ -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