aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs31
1 files changed, 17 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs
index 2a1c19c..a297309 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs
@@ -36,29 +36,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
36{ 36{
37 public class LSL_EventTests : OpenSimTestCase 37 public class LSL_EventTests : OpenSimTestCase
38 { 38 {
39 CSCodeGenerator m_cg = new CSCodeGenerator();
40
39 [Test] 41 [Test]
40 public void TestStateEntryEvent() 42 public void TestStateEntryEvent()
41 { 43 {
42 TestHelpers.InMethod(); 44 TestHelpers.InMethod();
43// TestHelpers.EnableLogging(); 45// TestHelpers.EnableLogging();
44 46
45 CSCodeGenerator cg = new CSCodeGenerator(); 47 TestCompile("default { state_entry() {} }", false);
46 cg.Convert("default { state_entry() {} }"); 48 TestCompile("default { state_entry(integer n) {} }", true);
47 49 }
48 {
49 bool gotException = false;
50 50
51 try 51 private void TestCompile(string script, bool expectException)
52 { 52 {
53 cg.Convert("default { state_entry(integer n) {} }"); 53 bool gotException = false;
54 }
55 catch (Exception )
56 {
57 gotException = true;
58 }
59 54
60 Assert.That(gotException, Is.True); 55 try
56 {
57 m_cg.Convert(script);
58 }
59 catch (Exception)
60 {
61 gotException = true;
61 } 62 }
63
64 Assert.That(gotException, Is.EqualTo(expectException));
62 } 65 }
63 } 66 }
64} \ No newline at end of file 67} \ No newline at end of file