diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs index 5dcdf1a..67ce10a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs | |||
@@ -48,6 +48,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
48 | } | 48 | } |
49 | 49 | ||
50 | [Test] | 50 | [Test] |
51 | public void TestAttachEvent() | ||
52 | { | ||
53 | TestHelpers.InMethod(); | ||
54 | // TestHelpers.EnableLogging(); | ||
55 | |||
56 | TestKeyArgEvent("attach"); | ||
57 | } | ||
58 | |||
59 | [Test] | ||
60 | public void TestObjectRezEvent() | ||
61 | { | ||
62 | TestHelpers.InMethod(); | ||
63 | // TestHelpers.EnableLogging(); | ||
64 | |||
65 | TestKeyArgEvent("object_rez"); | ||
66 | } | ||
67 | |||
68 | [Test] | ||
51 | public void TestMovingEndEvent() | 69 | public void TestMovingEndEvent() |
52 | { | 70 | { |
53 | TestHelpers.InMethod(); | 71 | TestHelpers.InMethod(); |
@@ -242,6 +260,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
242 | TestVectorArgEvent("land_collision_end"); | 260 | TestVectorArgEvent("land_collision_end"); |
243 | } | 261 | } |
244 | 262 | ||
263 | [Test] | ||
264 | public void TestAtRotTargetEvent() | ||
265 | { | ||
266 | TestHelpers.InMethod(); | ||
267 | // TestHelpers.EnableLogging(); | ||
268 | |||
269 | TestIntRotRotArgEvent("at_rot_target"); | ||
270 | } | ||
271 | |||
272 | [Test] | ||
273 | public void TestAtTargetEvent() | ||
274 | { | ||
275 | TestHelpers.InMethod(); | ||
276 | // TestHelpers.EnableLogging(); | ||
277 | |||
278 | TestIntVecVecArgEvent("at_target"); | ||
279 | } | ||
280 | |||
281 | [Test] | ||
282 | public void TestControlEvent() | ||
283 | { | ||
284 | TestHelpers.InMethod(); | ||
285 | // TestHelpers.EnableLogging(); | ||
286 | |||
287 | TestKeyIntIntArgEvent("control"); | ||
288 | } | ||
245 | 289 | ||
246 | private void TestIntArgEvent(string eventName) | 290 | private void TestIntArgEvent(string eventName) |
247 | { | 291 | { |
@@ -251,6 +295,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
251 | TestCompile("default { " + eventName + "(integer n, integer o) {{}} }", true); | 295 | TestCompile("default { " + eventName + "(integer n, integer o) {{}} }", true); |
252 | } | 296 | } |
253 | 297 | ||
298 | private void TestKeyArgEvent(string eventName) | ||
299 | { | ||
300 | TestCompile("default { " + eventName + "(key k) {} }", false); | ||
301 | TestCompile("default { " + eventName + "{{}} }", true); | ||
302 | TestCompile("default { " + eventName + "(string s) {{}} }", true); | ||
303 | TestCompile("default { " + eventName + "(key k, key l) {{}} }", true); | ||
304 | } | ||
305 | |||
254 | private void TestVectorArgEvent(string eventName) | 306 | private void TestVectorArgEvent(string eventName) |
255 | { | 307 | { |
256 | TestCompile("default { " + eventName + "(vector v) {} }", false); | 308 | TestCompile("default { " + eventName + "(vector v) {} }", false); |
@@ -259,6 +311,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
259 | TestCompile("default { " + eventName + "(vector v, vector w) {{}} }", true); | 311 | TestCompile("default { " + eventName + "(vector v, vector w) {{}} }", true); |
260 | } | 312 | } |
261 | 313 | ||
314 | private void TestIntRotRotArgEvent(string eventName) | ||
315 | { | ||
316 | TestCompile("default { " + eventName + "(integer n, rotation r, rotation s) {} }", false); | ||
317 | TestCompile("default { " + eventName + "{{}} }", true); | ||
318 | TestCompile("default { " + eventName + "(string s) {{}} }", true); | ||
319 | TestCompile("default { " + eventName + "(integer n, rotation r, rotation s, rotation t) {{}} }", true); | ||
320 | } | ||
321 | |||
322 | private void TestIntVecVecArgEvent(string eventName) | ||
323 | { | ||
324 | TestCompile("default { " + eventName + "(integer n, vector v, vector w) {} }", false); | ||
325 | TestCompile("default { " + eventName + "{{}} }", true); | ||
326 | TestCompile("default { " + eventName + "(string s) {{}} }", true); | ||
327 | TestCompile("default { " + eventName + "(integer n, vector v, vector w, vector x) {{}} }", true); | ||
328 | } | ||
329 | |||
330 | private void TestKeyIntIntArgEvent(string eventName) | ||
331 | { | ||
332 | TestCompile("default { " + eventName + "(key k, integer n, integer o) {} }", false); | ||
333 | TestCompile("default { " + eventName + "{{}} }", true); | ||
334 | TestCompile("default { " + eventName + "(string s) {{}} }", true); | ||
335 | TestCompile("default { " + eventName + "(key k, integer n, integer o, integer p) {{}} }", true); | ||
336 | } | ||
337 | |||
262 | private void TestCompile(string script, bool expectException) | 338 | private void TestCompile(string script, bool expectException) |
263 | { | 339 | { |
264 | bool gotException = false; | 340 | bool gotException = false; |