diff options
author | Justin Clark-Casey (justincc) | 2013-11-16 01:25:25 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-11-16 01:25:25 +0000 |
commit | d728c1beb27dfd3a31f9ad084d1c4094b27b65f9 (patch) | |
tree | c834425789d8abec071175e0739fb72427d8e150 | |
parent | Ignore *.suo and *.user as these are user specific preference files from Visu... (diff) | |
download | opensim-SC_OLD-d728c1beb27dfd3a31f9ad084d1c4094b27b65f9.zip opensim-SC_OLD-d728c1beb27dfd3a31f9ad084d1c4094b27b65f9.tar.gz opensim-SC_OLD-d728c1beb27dfd3a31f9ad084d1c4094b27b65f9.tar.bz2 opensim-SC_OLD-d728c1beb27dfd3a31f9ad084d1c4094b27b65f9.tar.xz |
refactor LSL_EventTests.TestStateEntryEvent into single method to test compile
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/LSL_EventTests.cs | 31 |
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 |