diff options
author | Justin Clark-Casey (justincc) | 2013-11-16 01:30:23 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-11-16 01:30:23 +0000 |
commit | 62006baaef46cc11816a90471454f256e3c8dd82 (patch) | |
tree | 7ea65eff2bf6a62740e4a5c391f54f32fa1d6498 /OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests | |
parent | refactor LSL_EventTests.TestStateEntryEvent into single method to test compile (diff) | |
download | opensim-SC_OLD-62006baaef46cc11816a90471454f256e3c8dd82.zip opensim-SC_OLD-62006baaef46cc11816a90471454f256e3c8dd82.tar.gz opensim-SC_OLD-62006baaef46cc11816a90471454f256e3c8dd82.tar.bz2 opensim-SC_OLD-62006baaef46cc11816a90471454f256e3c8dd82.tar.xz |
Make state_exit, moving_end, moving_start, not_at_rot_target, not_at_target and timer LSL events generate a syntax error if inappropriately given arguments.
This matches behaviour seen on the LL grid and a previous change for state_entry.
These are all the events which should take no arguments
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs | 60 |
1 files changed, 60 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 a297309..6c51060 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs | |||
@@ -39,6 +39,46 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
39 | CSCodeGenerator m_cg = new CSCodeGenerator(); | 39 | CSCodeGenerator m_cg = new CSCodeGenerator(); |
40 | 40 | ||
41 | [Test] | 41 | [Test] |
42 | public void TestMovingEndEvent() | ||
43 | { | ||
44 | TestHelpers.InMethod(); | ||
45 | // TestHelpers.EnableLogging(); | ||
46 | |||
47 | TestCompile("default { moving_end() {} }", false); | ||
48 | TestCompile("default { moving_end(integer n) {} }", true); | ||
49 | } | ||
50 | |||
51 | [Test] | ||
52 | public void TestMovingStartEvent() | ||
53 | { | ||
54 | TestHelpers.InMethod(); | ||
55 | // TestHelpers.EnableLogging(); | ||
56 | |||
57 | TestCompile("default { moving_start() {} }", false); | ||
58 | TestCompile("default { moving_start(integer n) {} }", true); | ||
59 | } | ||
60 | |||
61 | [Test] | ||
62 | public void TestNotAtRotTargetEvent() | ||
63 | { | ||
64 | TestHelpers.InMethod(); | ||
65 | // TestHelpers.EnableLogging(); | ||
66 | |||
67 | TestCompile("default { not_at_rot_target() {} }", false); | ||
68 | TestCompile("default { not_at_rot_target(integer n) {} }", true); | ||
69 | } | ||
70 | |||
71 | [Test] | ||
72 | public void TestNotAtTargetEvent() | ||
73 | { | ||
74 | TestHelpers.InMethod(); | ||
75 | // TestHelpers.EnableLogging(); | ||
76 | |||
77 | TestCompile("default { not_at_target() {} }", false); | ||
78 | TestCompile("default { not_at_target(integer n) {} }", true); | ||
79 | } | ||
80 | |||
81 | [Test] | ||
42 | public void TestStateEntryEvent() | 82 | public void TestStateEntryEvent() |
43 | { | 83 | { |
44 | TestHelpers.InMethod(); | 84 | TestHelpers.InMethod(); |
@@ -48,6 +88,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
48 | TestCompile("default { state_entry(integer n) {} }", true); | 88 | TestCompile("default { state_entry(integer n) {} }", true); |
49 | } | 89 | } |
50 | 90 | ||
91 | [Test] | ||
92 | public void TestStateExitEvent() | ||
93 | { | ||
94 | TestHelpers.InMethod(); | ||
95 | // TestHelpers.EnableLogging(); | ||
96 | |||
97 | TestCompile("default { state_exit() {} }", false); | ||
98 | TestCompile("default { state_exit(integer n) {} }", true); | ||
99 | } | ||
100 | |||
101 | [Test] | ||
102 | public void TestTimerEvent() | ||
103 | { | ||
104 | TestHelpers.InMethod(); | ||
105 | // TestHelpers.EnableLogging(); | ||
106 | |||
107 | TestCompile("default { timer() {} }", false); | ||
108 | TestCompile("default { timer(integer n) {} }", true); | ||
109 | } | ||
110 | |||
51 | private void TestCompile(string script, bool expectException) | 111 | private void TestCompile(string script, bool expectException) |
52 | { | 112 | { |
53 | bool gotException = false; | 113 | bool gotException = false; |