diff options
author | Justin Clark-Casey (justincc) | 2013-11-29 00:44:53 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-11-29 00:44:53 +0000 |
commit | a64377149d43f2c79bd39bb0accd863bb601f6a9 (patch) | |
tree | 71d7a8862433cbb24395a6d52663e3084a4d902f /OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-a64377149d43f2c79bd39bb0accd863bb601f6a9.zip opensim-SC_OLD-a64377149d43f2c79bd39bb0accd863bb601f6a9.tar.gz opensim-SC_OLD-a64377149d43f2c79bd39bb0accd863bb601f6a9.tar.bz2 opensim-SC_OLD-a64377149d43f2c79bd39bb0accd863bb601f6a9.tar.xz |
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
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs index 53ce405..5dcdf1a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs | |||
@@ -213,7 +213,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
213 | // TestHelpers.EnableLogging(); | 213 | // TestHelpers.EnableLogging(); |
214 | 214 | ||
215 | TestIntArgEvent("touch_end"); | 215 | TestIntArgEvent("touch_end"); |
216 | } | 216 | } |
217 | |||
218 | [Test] | ||
219 | public void TestLandCollisionEvent() | ||
220 | { | ||
221 | TestHelpers.InMethod(); | ||
222 | // TestHelpers.EnableLogging(); | ||
223 | |||
224 | TestVectorArgEvent("land_collision"); | ||
225 | } | ||
226 | |||
227 | [Test] | ||
228 | public void TestLandCollisionStartEvent() | ||
229 | { | ||
230 | TestHelpers.InMethod(); | ||
231 | // TestHelpers.EnableLogging(); | ||
232 | |||
233 | TestVectorArgEvent("land_collision_start"); | ||
234 | } | ||
235 | |||
236 | [Test] | ||
237 | public void TestLandCollisionEndEvent() | ||
238 | { | ||
239 | TestHelpers.InMethod(); | ||
240 | // TestHelpers.EnableLogging(); | ||
241 | |||
242 | TestVectorArgEvent("land_collision_end"); | ||
243 | } | ||
244 | |||
217 | 245 | ||
218 | private void TestIntArgEvent(string eventName) | 246 | private void TestIntArgEvent(string eventName) |
219 | { | 247 | { |
@@ -223,6 +251,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
223 | TestCompile("default { " + eventName + "(integer n, integer o) {{}} }", true); | 251 | TestCompile("default { " + eventName + "(integer n, integer o) {{}} }", true); |
224 | } | 252 | } |
225 | 253 | ||
254 | private void TestVectorArgEvent(string eventName) | ||
255 | { | ||
256 | TestCompile("default { " + eventName + "(vector v) {} }", false); | ||
257 | TestCompile("default { " + eventName + "{{}} }", true); | ||
258 | TestCompile("default { " + eventName + "(string s) {{}} }", true); | ||
259 | TestCompile("default { " + eventName + "(vector v, vector w) {{}} }", true); | ||
260 | } | ||
261 | |||
226 | private void TestCompile(string script, bool expectException) | 262 | private void TestCompile(string script, bool expectException) |
227 | { | 263 | { |
228 | bool gotException = false; | 264 | bool gotException = false; |