aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs53
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs25
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs12
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs117
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs7
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs11
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLFloat.cs74
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLString.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestList.cs42
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestVector3.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs29
15 files changed, 361 insertions, 54 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
index 14edde4..993d10f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -247,7 +247,58 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
247 247
248 // Remove Sensors 248 // Remove Sensors
249 m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID); 249 m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID);
250 }
251
252 /// <summary>
253 /// Get the sensor repeat plugin for this script engine.
254 /// </summary>
255 /// <param name="engine"></param>
256 /// <returns></returns>
257 public static SensorRepeat GetSensorRepeatPlugin(IScriptEngine engine)
258 {
259 if (m_SensorRepeat.ContainsKey(engine))
260 return m_SensorRepeat[engine];
261 else
262 return null;
263 }
250 264
265 /// <summary>
266 /// Get the dataserver plugin for this script engine.
267 /// </summary>
268 /// <param name="engine"></param>
269 /// <returns></returns>
270 public static Dataserver GetDataserverPlugin(IScriptEngine engine)
271 {
272 if (m_Dataserver.ContainsKey(engine))
273 return m_Dataserver[engine];
274 else
275 return null;
276 }
277
278 /// <summary>
279 /// Get the timer plugin for this script engine.
280 /// </summary>
281 /// <param name="engine"></param>
282 /// <returns></returns>
283 public static Timer GetTimerPlugin(IScriptEngine engine)
284 {
285 if (m_Timer.ContainsKey(engine))
286 return m_Timer[engine];
287 else
288 return null;
289 }
290
291 /// <summary>
292 /// Get the listener plugin for this script engine.
293 /// </summary>
294 /// <param name="engine"></param>
295 /// <returns></returns>
296 public static Listener GetListenerPlugin(IScriptEngine engine)
297 {
298 if (m_Listener.ContainsKey(engine))
299 return m_Listener[engine];
300 else
301 return null;
251 } 302 }
252 303
253 public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID) 304 public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID)
@@ -270,7 +321,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
270 data.AddRange(timers); 321 data.AddRange(timers);
271 } 322 }
272 323
273 Object[] sensors=m_SensorRepeat[engine].GetSerializationData(itemID); 324 Object[] sensors = m_SensorRepeat[engine].GetSerializationData(itemID);
274 if (sensors.Length > 0) 325 if (sensors.Length > 0)
275 { 326 {
276 data.Add("sensor"); 327 data.Add("sensor");
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs
index 7fa19b1..9f78a49 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs
@@ -38,6 +38,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
38 { 38 {
39 public AsyncCommandManager m_CmdManager; 39 public AsyncCommandManager m_CmdManager;
40 40
41 public int DataserverRequestsCount
42 {
43 get
44 {
45 lock (DataserverRequests)
46 return DataserverRequests.Count;
47 }
48 }
49
41 private Dictionary<string, DataserverRequest> DataserverRequests = 50 private Dictionary<string, DataserverRequest> DataserverRequests =
42 new Dictionary<string, DataserverRequest>(); 51 new Dictionary<string, DataserverRequest>();
43 52
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs
index 740816f..93e0261 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs
@@ -42,22 +42,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
42 42
43 public AsyncCommandManager m_CmdManager; 43 public AsyncCommandManager m_CmdManager;
44 44
45 private IWorldComm m_commsPlugin;
46
47 public int ListenerCount
48 {
49 get { return m_commsPlugin.ListenerCount; }
50 }
51
45 public Listener(AsyncCommandManager CmdManager) 52 public Listener(AsyncCommandManager CmdManager)
46 { 53 {
47 m_CmdManager = CmdManager; 54 m_CmdManager = CmdManager;
55 m_commsPlugin = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
48 } 56 }
49 57
50 public void CheckListeners() 58 public void CheckListeners()
51 { 59 {
52 if (m_CmdManager.m_ScriptEngine.World == null) 60 if (m_CmdManager.m_ScriptEngine.World == null)
53 return; 61 return;
54 IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
55 62
56 if (comms != null) 63 if (m_commsPlugin != null)
57 { 64 {
58 while (comms.HasMessages()) 65 while (m_commsPlugin.HasMessages())
59 { 66 {
60 ListenerInfo lInfo = (ListenerInfo)comms.GetNextMessage(); 67 ListenerInfo lInfo = (ListenerInfo)m_commsPlugin.GetNextMessage();
61 68
62 //Deliver data to prim's listen handler 69 //Deliver data to prim's listen handler
63 object[] resobj = new object[] 70 object[] resobj = new object[]
@@ -81,17 +88,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
81 88
82 public Object[] GetSerializationData(UUID itemID) 89 public Object[] GetSerializationData(UUID itemID)
83 { 90 {
84 IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 91 return m_commsPlugin.GetSerializationData(itemID);
85
86 return comms.GetSerializationData(itemID);
87 } 92 }
88 93
89 public void CreateFromData(uint localID, UUID itemID, UUID hostID, 94 public void CreateFromData(uint localID, UUID itemID, UUID hostID,
90 Object[] data) 95 Object[] data)
91 { 96 {
92 IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 97 m_commsPlugin.CreateFromData(localID, itemID, hostID, data);
93
94 comms.CreateFromData(localID, itemID, hostID, data);
95 } 98 }
96 } 99 }
97} 100} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index fbb7c39..1c272f8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -44,6 +44,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
44 44
45 public AsyncCommandManager m_CmdManager; 45 public AsyncCommandManager m_CmdManager;
46 46
47 /// <summary>
48 /// Number of sensors active.
49 /// </summary>
50 public int SensorsCount
51 {
52 get
53 {
54 lock (SenseRepeatListLock)
55 return SenseRepeaters.Count;
56 }
57 }
58
47 public SensorRepeat(AsyncCommandManager CmdManager) 59 public SensorRepeat(AsyncCommandManager CmdManager)
48 { 60 {
49 m_CmdManager = CmdManager; 61 m_CmdManager = CmdManager;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
index eeb59d9..bc63030 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
@@ -37,6 +37,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
37 { 37 {
38 public AsyncCommandManager m_CmdManager; 38 public AsyncCommandManager m_CmdManager;
39 39
40 public int TimersCount
41 {
42 get
43 {
44 lock (TimerListLock)
45 return Timers.Count;
46 }
47 }
48
40 public Timer(AsyncCommandManager CmdManager) 49 public Timer(AsyncCommandManager CmdManager)
41 { 50 {
42 m_CmdManager = CmdManager; 51 m_CmdManager = CmdManager;
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
index 8b88588..65d3b9b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
@@ -118,7 +118,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
118 emessage = emessage.Substring(slinfo.Length+2); 118 emessage = emessage.Substring(slinfo.Length+2);
119 119
120 message = String.Format("({0},{1}) {2}", 120 message = String.Format("({0},{1}) {2}",
121 e.slInfo.lineNumber - 2, 121 e.slInfo.lineNumber - 1,
122 e.slInfo.charPosition - 1, emessage); 122 e.slInfo.charPosition - 1, emessage);
123 123
124 throw new Exception(message); 124 throw new Exception(message);
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs
index 63afb0b..7763619 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs
@@ -29,6 +29,7 @@ using System.Collections.Generic;
29using System.Text.RegularExpressions; 29using System.Text.RegularExpressions;
30using NUnit.Framework; 30using NUnit.Framework;
31using OpenSim.Region.ScriptEngine.Shared.CodeTools; 31using OpenSim.Region.ScriptEngine.Shared.CodeTools;
32using OpenSim.Tests.Common;
32 33
33namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests 34namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
34{ 35{
@@ -43,6 +44,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
43 [Test] 44 [Test]
44 public void TestDefaultState() 45 public void TestDefaultState()
45 { 46 {
47 TestHelpers.InMethod();
48
46 string input = @"default 49 string input = @"default
47{ 50{
48 state_entry() 51 state_entry()
@@ -63,6 +66,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
63 [Test] 66 [Test]
64 public void TestCustomState() 67 public void TestCustomState()
65 { 68 {
69 TestHelpers.InMethod();
70
66 string input = @"default 71 string input = @"default
67{ 72{
68 state_entry() 73 state_entry()
@@ -93,6 +98,8 @@ state another_state
93 [Test] 98 [Test]
94 public void TestEventWithArguments() 99 public void TestEventWithArguments()
95 { 100 {
101 TestHelpers.InMethod();
102
96 string input = @"default 103 string input = @"default
97{ 104{
98 at_rot_target(integer tnum, rotation targetrot, rotation ourrot) 105 at_rot_target(integer tnum, rotation targetrot, rotation ourrot)
@@ -113,6 +120,8 @@ state another_state
113 [Test] 120 [Test]
114 public void TestIntegerDeclaration() 121 public void TestIntegerDeclaration()
115 { 122 {
123 TestHelpers.InMethod();
124
116 string input = @"default 125 string input = @"default
117{ 126{
118 touch_start(integer num_detected) 127 touch_start(integer num_detected)
@@ -135,6 +144,8 @@ state another_state
135 [Test] 144 [Test]
136 public void TestLoneIdent() 145 public void TestLoneIdent()
137 { 146 {
147 TestHelpers.InMethod();
148
138 // A lone ident should be removed completely as it's an error in C# 149 // A lone ident should be removed completely as it's an error in C#
139 // (MONO at least). 150 // (MONO at least).
140 string input = @"default 151 string input = @"default
@@ -161,6 +172,8 @@ state another_state
161 [Test] 172 [Test]
162 public void TestAssignments() 173 public void TestAssignments()
163 { 174 {
175 TestHelpers.InMethod();
176
164 string input = @"default 177 string input = @"default
165{ 178{
166 touch_start(integer num_detected) 179 touch_start(integer num_detected)
@@ -187,6 +200,8 @@ state another_state
187 [Test] 200 [Test]
188 public void TestAdditionSubtractionOperator() 201 public void TestAdditionSubtractionOperator()
189 { 202 {
203 TestHelpers.InMethod();
204
190 string input = @"default 205 string input = @"default
191{ 206{
192 touch_start(integer num_detected) 207 touch_start(integer num_detected)
@@ -215,6 +230,8 @@ state another_state
215 [Test] 230 [Test]
216 public void TestStrings() 231 public void TestStrings()
217 { 232 {
233 TestHelpers.InMethod();
234
218 string input = @"default 235 string input = @"default
219{ 236{
220 touch_start(integer num_detected) 237 touch_start(integer num_detected)
@@ -242,6 +259,8 @@ state another_state
242 [Test] 259 [Test]
243 public void TestBinaryExpression() 260 public void TestBinaryExpression()
244 { 261 {
262 TestHelpers.InMethod();
263
245 string input = @"default 264 string input = @"default
246{ 265{
247 touch_start(integer num_detected) 266 touch_start(integer num_detected)
@@ -284,6 +303,8 @@ state another_state
284 [Test] 303 [Test]
285 public void TestFloatConstants() 304 public void TestFloatConstants()
286 { 305 {
306 TestHelpers.InMethod();
307
287 string input = @"default 308 string input = @"default
288{ 309{
289 touch_start(integer num_detected) 310 touch_start(integer num_detected)
@@ -336,6 +357,8 @@ state another_state
336 [Test] 357 [Test]
337 public void TestComments() 358 public void TestComments()
338 { 359 {
360 TestHelpers.InMethod();
361
339 string input = @"// this test tests comments 362 string input = @"// this test tests comments
340default 363default
341{ 364{
@@ -358,6 +381,8 @@ default
358 [Test] 381 [Test]
359 public void TestStringsWithEscapedQuotesAndComments() 382 public void TestStringsWithEscapedQuotesAndComments()
360 { 383 {
384 TestHelpers.InMethod();
385
361 string input = @"// this test tests strings, with escaped quotes and comments in strings 386 string input = @"// this test tests strings, with escaped quotes and comments in strings
362default 387default
363{ 388{
@@ -397,6 +422,8 @@ default
397 [Test] 422 [Test]
398 public void TestCStyleComments() 423 public void TestCStyleComments()
399 { 424 {
425 TestHelpers.InMethod();
426
400 string input = @"/* this test tests comments 427 string input = @"/* this test tests comments
401 of the C variety 428 of the C variety
402*/ 429*/
@@ -426,6 +453,8 @@ default
426 [Test] 453 [Test]
427 public void TestGlobalDefinedFunctions() 454 public void TestGlobalDefinedFunctions()
428 { 455 {
456 TestHelpers.InMethod();
457
429 string input = @"// this test tests custom defined functions 458 string input = @"// this test tests custom defined functions
430 459
431string onefunc() 460string onefunc()
@@ -470,6 +499,8 @@ default
470 [Test] 499 [Test]
471 public void TestGlobalDeclaredVariables() 500 public void TestGlobalDeclaredVariables()
472 { 501 {
502 TestHelpers.InMethod();
503
473 string input = @"// this test tests custom defined functions and global variables 504 string input = @"// this test tests custom defined functions and global variables
474 505
475string globalString; 506string globalString;
@@ -525,6 +556,8 @@ default
525 [Test] 556 [Test]
526 public void TestMoreAssignments() 557 public void TestMoreAssignments()
527 { 558 {
559 TestHelpers.InMethod();
560
528 string input = @"// this test tests +=, -=, *=, /=, %= 561 string input = @"// this test tests +=, -=, *=, /=, %=
529 562
530string globalString; 563string globalString;
@@ -579,6 +612,8 @@ default
579 [Test] 612 [Test]
580 public void TestVectorConstantNotation() 613 public void TestVectorConstantNotation()
581 { 614 {
615 TestHelpers.InMethod();
616
582 string input = @"default 617 string input = @"default
583{ 618{
584 touch_start(integer num_detected) 619 touch_start(integer num_detected)
@@ -606,6 +641,8 @@ default
606 [Test] 641 [Test]
607 public void TestVectorMemberAccess() 642 public void TestVectorMemberAccess()
608 { 643 {
644 TestHelpers.InMethod();
645
609 string input = @"default 646 string input = @"default
610{ 647{
611 touch_start(integer num_detected) 648 touch_start(integer num_detected)
@@ -632,6 +669,8 @@ default
632 [Test] 669 [Test]
633 public void TestExpressionInParentheses() 670 public void TestExpressionInParentheses()
634 { 671 {
672 TestHelpers.InMethod();
673
635 string input = @"default 674 string input = @"default
636{ 675{
637 touch_start(integer num_detected) 676 touch_start(integer num_detected)
@@ -660,6 +699,8 @@ default
660 [Test] 699 [Test]
661 public void TestIncrementDecrementOperator() 700 public void TestIncrementDecrementOperator()
662 { 701 {
702 TestHelpers.InMethod();
703
663 string input = @"// here we'll test the ++ and -- operators 704 string input = @"// here we'll test the ++ and -- operators
664 705
665default 706default
@@ -690,6 +731,8 @@ default
690 [Test] 731 [Test]
691 public void TestLists() 732 public void TestLists()
692 { 733 {
734 TestHelpers.InMethod();
735
693 string input = @"// testing lists 736 string input = @"// testing lists
694 737
695default 738default
@@ -718,6 +761,8 @@ default
718 [Test] 761 [Test]
719 public void TestIfStatement() 762 public void TestIfStatement()
720 { 763 {
764 TestHelpers.InMethod();
765
721 string input = @"// let's test if statements 766 string input = @"// let's test if statements
722 767
723default 768default
@@ -822,6 +867,8 @@ default
822 [Test] 867 [Test]
823 public void TestIfElseStatement() 868 public void TestIfElseStatement()
824 { 869 {
870 TestHelpers.InMethod();
871
825 string input = @"// let's test complex logical expressions 872 string input = @"// let's test complex logical expressions
826 873
827default 874default
@@ -928,6 +975,8 @@ default
928 [Test] 975 [Test]
929 public void TestWhileLoop() 976 public void TestWhileLoop()
930 { 977 {
978 TestHelpers.InMethod();
979
931 string input = @"// let's test while loops 980 string input = @"// let's test while loops
932 981
933default 982default
@@ -968,6 +1017,8 @@ default
968 [Test] 1017 [Test]
969 public void TestDoWhileLoop() 1018 public void TestDoWhileLoop()
970 { 1019 {
1020 TestHelpers.InMethod();
1021
971 string input = @"// let's test do-while loops 1022 string input = @"// let's test do-while loops
972 1023
973default 1024default
@@ -1012,6 +1063,8 @@ default
1012 [Test] 1063 [Test]
1013 public void TestForLoop() 1064 public void TestForLoop()
1014 { 1065 {
1066 TestHelpers.InMethod();
1067
1015 string input = @"// let's test for loops 1068 string input = @"// let's test for loops
1016 1069
1017default 1070default
@@ -1056,6 +1109,8 @@ default
1056 [Test] 1109 [Test]
1057 public void TestFloatsWithTrailingDecimal() 1110 public void TestFloatsWithTrailingDecimal()
1058 { 1111 {
1112 TestHelpers.InMethod();
1113
1059 string input = @"// a curious feature of LSL that allows floats to be defined with a trailing dot 1114 string input = @"// a curious feature of LSL that allows floats to be defined with a trailing dot
1060 1115
1061default 1116default
@@ -1108,6 +1163,8 @@ default
1108 [Test] 1163 [Test]
1109 public void TestUnaryAndBinaryOperators() 1164 public void TestUnaryAndBinaryOperators()
1110 { 1165 {
1166 TestHelpers.InMethod();
1167
1111 string input = @"// let's test a few more operators 1168 string input = @"// let's test a few more operators
1112 1169
1113default 1170default
@@ -1144,6 +1201,8 @@ default
1144 [Test] 1201 [Test]
1145 public void TestTypecasts() 1202 public void TestTypecasts()
1146 { 1203 {
1204 TestHelpers.InMethod();
1205
1147 string input = @"// let's test typecasts 1206 string input = @"// let's test typecasts
1148 1207
1149default 1208default
@@ -1189,6 +1248,8 @@ default
1189 [Test] 1248 [Test]
1190 public void TestStates() 1249 public void TestStates()
1191 { 1250 {
1251 TestHelpers.InMethod();
1252
1192 string input = @"// let's test states 1253 string input = @"// let's test states
1193 1254
1194default 1255default
@@ -1229,6 +1290,8 @@ state statetwo
1229 [Test] 1290 [Test]
1230 public void TestHexIntegerConstants() 1291 public void TestHexIntegerConstants()
1231 { 1292 {
1293 TestHelpers.InMethod();
1294
1232 string input = @"// let's test hex integers 1295 string input = @"// let's test hex integers
1233 1296
1234default 1297default
@@ -1261,6 +1324,8 @@ default
1261 [Test] 1324 [Test]
1262 public void TestJumps() 1325 public void TestJumps()
1263 { 1326 {
1327 TestHelpers.InMethod();
1328
1264 string input = @"// let's test jumps 1329 string input = @"// let's test jumps
1265 1330
1266default 1331default
@@ -1291,6 +1356,8 @@ default
1291 [Test] 1356 [Test]
1292 public void TestImplicitVariableInitialization() 1357 public void TestImplicitVariableInitialization()
1293 { 1358 {
1359 TestHelpers.InMethod();
1360
1294 string input = @"// let's test implicitly initializing variables 1361 string input = @"// let's test implicitly initializing variables
1295 1362
1296default 1363default
@@ -1334,6 +1401,8 @@ default
1334 [Test] 1401 [Test]
1335 public void TestMultipleEqualsExpression() 1402 public void TestMultipleEqualsExpression()
1336 { 1403 {
1404 TestHelpers.InMethod();
1405
1337 string input = @"// let's test x = y = 5 type expressions 1406 string input = @"// let's test x = y = 5 type expressions
1338 1407
1339default 1408default
@@ -1366,6 +1435,8 @@ default
1366 [Test] 1435 [Test]
1367 public void TestUnaryExpressionLastInVectorConstant() 1436 public void TestUnaryExpressionLastInVectorConstant()
1368 { 1437 {
1438 TestHelpers.InMethod();
1439
1369 string input = @"// let's test unary expressions some more 1440 string input = @"// let's test unary expressions some more
1370 1441
1371default 1442default
@@ -1390,6 +1461,8 @@ default
1390 [Test] 1461 [Test]
1391 public void TestVectorMemberPlusEquals() 1462 public void TestVectorMemberPlusEquals()
1392 { 1463 {
1464 TestHelpers.InMethod();
1465
1393 string input = @"// let's test unary expressions some more 1466 string input = @"// let's test unary expressions some more
1394 1467
1395default 1468default
@@ -1424,6 +1497,8 @@ default
1424 [Test] 1497 [Test]
1425 public void TestWhileLoopWithNoBody() 1498 public void TestWhileLoopWithNoBody()
1426 { 1499 {
1500 TestHelpers.InMethod();
1501
1427 string input = @"default 1502 string input = @"default
1428{ 1503{
1429 state_entry() 1504 state_entry()
@@ -1447,6 +1522,8 @@ default
1447 [Test] 1522 [Test]
1448 public void TestDoWhileLoopWithNoBody() 1523 public void TestDoWhileLoopWithNoBody()
1449 { 1524 {
1525 TestHelpers.InMethod();
1526
1450 string input = @"default 1527 string input = @"default
1451{ 1528{
1452 state_entry() 1529 state_entry()
@@ -1472,6 +1549,8 @@ default
1472 [Test] 1549 [Test]
1473 public void TestIfWithNoBody() 1550 public void TestIfWithNoBody()
1474 { 1551 {
1552 TestHelpers.InMethod();
1553
1475 string input = @"default 1554 string input = @"default
1476{ 1555{
1477 state_entry() 1556 state_entry()
@@ -1495,6 +1574,8 @@ default
1495 [Test] 1574 [Test]
1496 public void TestIfElseWithNoBody() 1575 public void TestIfElseWithNoBody()
1497 { 1576 {
1577 TestHelpers.InMethod();
1578
1498 string input = @"default 1579 string input = @"default
1499{ 1580{
1500 state_entry() 1581 state_entry()
@@ -1521,6 +1602,8 @@ default
1521 [Test] 1602 [Test]
1522 public void TestForLoopWithNoBody() 1603 public void TestForLoopWithNoBody()
1523 { 1604 {
1605 TestHelpers.InMethod();
1606
1524 string input = @"default 1607 string input = @"default
1525{ 1608{
1526 state_entry() 1609 state_entry()
@@ -1544,6 +1627,8 @@ default
1544 [Test] 1627 [Test]
1545 public void TestForLoopWithNoAssignment() 1628 public void TestForLoopWithNoAssignment()
1546 { 1629 {
1630 TestHelpers.InMethod();
1631
1547 string input = @"default 1632 string input = @"default
1548{ 1633{
1549 state_entry() 1634 state_entry()
@@ -1569,6 +1654,8 @@ default
1569 [Test] 1654 [Test]
1570 public void TestForLoopWithOnlyIdentInAssignment() 1655 public void TestForLoopWithOnlyIdentInAssignment()
1571 { 1656 {
1657 TestHelpers.InMethod();
1658
1572 string input = @"default 1659 string input = @"default
1573{ 1660{
1574 state_entry() 1661 state_entry()
@@ -1594,6 +1681,8 @@ default
1594 [Test] 1681 [Test]
1595 public void TestAssignmentInIfWhileDoWhile() 1682 public void TestAssignmentInIfWhileDoWhile()
1596 { 1683 {
1684 TestHelpers.InMethod();
1685
1597 string input = @"default 1686 string input = @"default
1598{ 1687{
1599 state_entry() 1688 state_entry()
@@ -1631,6 +1720,8 @@ default
1631 [Test] 1720 [Test]
1632 public void TestLSLListHack() 1721 public void TestLSLListHack()
1633 { 1722 {
1723 TestHelpers.InMethod();
1724
1634 string input = @"default 1725 string input = @"default
1635{ 1726{
1636 state_entry() 1727 state_entry()
@@ -1653,9 +1744,12 @@ default
1653 } 1744 }
1654 1745
1655 [Test] 1746 [Test]
1656 [ExpectedException(typeof(System.Exception))]
1657 public void TestSyntaxError() 1747 public void TestSyntaxError()
1658 { 1748 {
1749 TestHelpers.InMethod();
1750
1751 bool gotException = false;
1752
1659 string input = @"default 1753 string input = @"default
1660{ 1754{
1661 state_entry() 1755 state_entry()
@@ -1671,17 +1765,22 @@ default
1671 } 1765 }
1672 catch (System.Exception e) 1766 catch (System.Exception e)
1673 { 1767 {
1674 // The syntax error is on line 6, char 5 (expected ';', found 1768 // The syntax error is on line 5, char 4 (expected ';', found
1675 // '}'). 1769 // '}').
1676 Assert.AreEqual("(4,4) syntax error", e.Message); 1770 Assert.AreEqual("(5,4) syntax error", e.Message);
1677 throw; 1771 gotException = true;
1678 } 1772 }
1773
1774 Assert.That(gotException, Is.True);
1679 } 1775 }
1680 1776
1681 [Test] 1777 [Test]
1682 [ExpectedException(typeof(System.Exception))]
1683 public void TestSyntaxErrorDeclaringVariableInForLoop() 1778 public void TestSyntaxErrorDeclaringVariableInForLoop()
1684 { 1779 {
1780 TestHelpers.InMethod();
1781
1782 bool gotException = false;
1783
1685 string input = @"default 1784 string input = @"default
1686{ 1785{
1687 state_entry() 1786 state_entry()
@@ -1697,11 +1796,13 @@ default
1697 } 1796 }
1698 catch (System.Exception e) 1797 catch (System.Exception e)
1699 { 1798 {
1700 // The syntax error is on line 5, char 14 (Syntax error) 1799 // The syntax error is on line 4, char 13 (Syntax error)
1701 Assert.AreEqual("(3,13) syntax error", e.Message); 1800 Assert.AreEqual("(4,13) syntax error", e.Message);
1702 1801
1703 throw; 1802 gotException = true;
1704 } 1803 }
1804
1805 Assert.That(gotException, Is.True);
1705 } 1806 }
1706 } 1807 }
1707} 1808}
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
index c5483c8..1fa6954 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
@@ -31,6 +31,7 @@ using System.Collections.Generic;
31using Microsoft.CSharp; 31using Microsoft.CSharp;
32using NUnit.Framework; 32using NUnit.Framework;
33using OpenSim.Region.ScriptEngine.Shared.CodeTools; 33using OpenSim.Region.ScriptEngine.Shared.CodeTools;
34using OpenSim.Tests.Common;
34 35
35namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests 36namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
36{ 37{
@@ -92,6 +93,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
92 //[Test] 93 //[Test]
93 public void TestUseUndeclaredVariable() 94 public void TestUseUndeclaredVariable()
94 { 95 {
96 TestHelpers.InMethod();
97
95 m_compilerParameters.OutputAssembly = Path.Combine(m_testDir, Path.GetRandomFileName() + ".dll"); 98 m_compilerParameters.OutputAssembly = Path.Combine(m_testDir, Path.GetRandomFileName() + ".dll");
96 99
97 string input = @"default 100 string input = @"default
@@ -124,6 +127,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
124 //[Test] 127 //[Test]
125 public void TestCastAndConcatString() 128 public void TestCastAndConcatString()
126 { 129 {
130 TestHelpers.InMethod();
131
127 m_compilerParameters.OutputAssembly = Path.Combine(m_testDir, Path.GetRandomFileName() + ".dll"); 132 m_compilerParameters.OutputAssembly = Path.Combine(m_testDir, Path.GetRandomFileName() + ".dll");
128 133
129 string input = @"string s = "" a string""; 134 string input = @"string s = "" a string"";
@@ -150,4 +155,4 @@ default
150 Assert.AreEqual(0, m_compilerResults.Errors.Count); 155 Assert.AreEqual(0, m_compilerResults.Errors.Count);
151 } 156 }
152 } 157 }
153} 158} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
index 3baa723..9cf9258 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
@@ -46,7 +46,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
46 [TestFixture, LongRunning] 46 [TestFixture, LongRunning]
47 public class LSL_ApiTest 47 public class LSL_ApiTest
48 { 48 {
49
50 private const double ANGLE_ACCURACY_IN_RADIANS = 1E-6; 49 private const double ANGLE_ACCURACY_IN_RADIANS = 1E-6;
51 private const double VECTOR_COMPONENT_ACCURACY = 0.0000005d; 50 private const double VECTOR_COMPONENT_ACCURACY = 0.0000005d;
52 private const float FLOAT_ACCURACY = 0.00005f; 51 private const float FLOAT_ACCURACY = 0.00005f;
@@ -55,7 +54,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
55 [SetUp] 54 [SetUp]
56 public void SetUp() 55 public void SetUp()
57 { 56 {
58
59 IConfigSource initConfigSource = new IniConfigSource(); 57 IConfigSource initConfigSource = new IniConfigSource();
60 IConfig config = initConfigSource.AddConfig("XEngine"); 58 IConfig config = initConfigSource.AddConfig("XEngine");
61 config.Set("Enabled", "true"); 59 config.Set("Enabled", "true");
@@ -75,6 +73,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
75 [Test] 73 [Test]
76 public void TestllAngleBetween() 74 public void TestllAngleBetween()
77 { 75 {
76 TestHelpers.InMethod();
77
78 CheckllAngleBetween(new Vector3(1, 0, 0), 0, 1, 1); 78 CheckllAngleBetween(new Vector3(1, 0, 0), 0, 1, 1);
79 CheckllAngleBetween(new Vector3(1, 0, 0), 90, 1, 1); 79 CheckllAngleBetween(new Vector3(1, 0, 0), 90, 1, 1);
80 CheckllAngleBetween(new Vector3(1, 0, 0), 180, 1, 1); 80 CheckllAngleBetween(new Vector3(1, 0, 0), 180, 1, 1);
@@ -158,6 +158,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
158 // llRot2Euler test. 158 // llRot2Euler test.
159 public void TestllRot2Euler() 159 public void TestllRot2Euler()
160 { 160 {
161 TestHelpers.InMethod();
162
161 // 180, 90 and zero degree rotations. 163 // 180, 90 and zero degree rotations.
162 CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.0f, 1.0f)); 164 CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.0f, 1.0f));
163 CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.707107f, 0.707107f)); 165 CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.707107f, 0.707107f));
@@ -256,6 +258,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
256 // llSetPrimitiveParams and llGetPrimitiveParams test. 258 // llSetPrimitiveParams and llGetPrimitiveParams test.
257 public void TestllSetPrimitiveParams() 259 public void TestllSetPrimitiveParams()
258 { 260 {
261 TestHelpers.InMethod();
262
259 // Create Prim1. 263 // Create Prim1.
260 Scene scene = SceneHelpers.SetupScene(); 264 Scene scene = SceneHelpers.SetupScene();
261 string obj1Name = "Prim1"; 265 string obj1Name = "Prim1";
@@ -486,9 +490,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
486 } 490 }
487 491
488 [Test] 492 [Test]
489 // llVecNorm test.
490 public void TestllVecNorm() 493 public void TestllVecNorm()
491 { 494 {
495 TestHelpers.InMethod();
496
492 // Check special case for normalizing zero vector. 497 // Check special case for normalizing zero vector.
493 CheckllVecNorm(new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), new LSL_Types.Vector3(0.0d, 0.0d, 0.0d)); 498 CheckllVecNorm(new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), new LSL_Types.Vector3(0.0d, 0.0d, 0.0d));
494 // Check various vectors. 499 // Check various vectors.
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLFloat.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLFloat.cs
index 10b52cf..3ed2562 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLFloat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLFloat.cs
@@ -213,6 +213,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
213 [Test] 213 [Test]
214 public void TestConstructFromInt() 214 public void TestConstructFromInt()
215 { 215 {
216 TestHelpers.InMethod();
217
216 LSL_Types.LSLFloat testFloat; 218 LSL_Types.LSLFloat testFloat;
217 219
218 foreach (KeyValuePair<int, double> number in m_intDoubleSet) 220 foreach (KeyValuePair<int, double> number in m_intDoubleSet)
@@ -228,6 +230,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
228 [Test] 230 [Test]
229 public void TestConstructFromDouble() 231 public void TestConstructFromDouble()
230 { 232 {
233 TestHelpers.InMethod();
234
231 LSL_Types.LSLFloat testFloat; 235 LSL_Types.LSLFloat testFloat;
232 236
233 foreach (KeyValuePair<double, double> number in m_doubleDoubleSet) 237 foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
@@ -243,6 +247,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
243 [Test] 247 [Test]
244 public void TestExplicitCastLSLFloatToInt() 248 public void TestExplicitCastLSLFloatToInt()
245 { 249 {
250 TestHelpers.InMethod();
251
246 int testNumber; 252 int testNumber;
247 253
248 foreach (KeyValuePair<double, int> number in m_doubleIntSet) 254 foreach (KeyValuePair<double, int> number in m_doubleIntSet)
@@ -258,6 +264,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
258 [Test] 264 [Test]
259 public void TestExplicitCastLSLFloatToUint() 265 public void TestExplicitCastLSLFloatToUint()
260 { 266 {
267 TestHelpers.InMethod();
268
261 uint testNumber; 269 uint testNumber;
262 270
263 foreach (KeyValuePair<double, int> number in m_doubleUintSet) 271 foreach (KeyValuePair<double, int> number in m_doubleUintSet)
@@ -273,6 +281,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
273 [Test] 281 [Test]
274 public void TestImplicitCastLSLFloatToBooleanTrue() 282 public void TestImplicitCastLSLFloatToBooleanTrue()
275 { 283 {
284 TestHelpers.InMethod();
285
276 LSL_Types.LSLFloat testFloat; 286 LSL_Types.LSLFloat testFloat;
277 bool testBool; 287 bool testBool;
278 288
@@ -291,6 +301,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
291 [Test] 301 [Test]
292 public void TestImplicitCastLSLFloatToBooleanFalse() 302 public void TestImplicitCastLSLFloatToBooleanFalse()
293 { 303 {
304 TestHelpers.InMethod();
305
294 LSL_Types.LSLFloat testFloat = new LSL_Types.LSLFloat(0.0); 306 LSL_Types.LSLFloat testFloat = new LSL_Types.LSLFloat(0.0);
295 bool testBool = testFloat; 307 bool testBool = testFloat;
296 308
@@ -303,6 +315,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
303 [Test] 315 [Test]
304 public void TestImplicitCastIntToLSLFloat() 316 public void TestImplicitCastIntToLSLFloat()
305 { 317 {
318 TestHelpers.InMethod();
319
306 LSL_Types.LSLFloat testFloat; 320 LSL_Types.LSLFloat testFloat;
307 321
308 foreach (int number in m_intList) 322 foreach (int number in m_intList)
@@ -318,6 +332,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
318 [Test] 332 [Test]
319 public void TestImplicitCastLSLIntegerToLSLFloat() 333 public void TestImplicitCastLSLIntegerToLSLFloat()
320 { 334 {
335 TestHelpers.InMethod();
336
321 LSL_Types.LSLFloat testFloat; 337 LSL_Types.LSLFloat testFloat;
322 338
323 foreach (int number in m_intList) 339 foreach (int number in m_intList)
@@ -333,6 +349,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
333 [Test] 349 [Test]
334 public void TestExplicitCastLSLIntegerToLSLFloat() 350 public void TestExplicitCastLSLIntegerToLSLFloat()
335 { 351 {
352 TestHelpers.InMethod();
353
336 LSL_Types.LSLFloat testFloat; 354 LSL_Types.LSLFloat testFloat;
337 355
338 foreach (int number in m_intList) 356 foreach (int number in m_intList)
@@ -348,6 +366,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
348 [Test] 366 [Test]
349 public void TestExplicitCastStringToLSLFloat() 367 public void TestExplicitCastStringToLSLFloat()
350 { 368 {
369 TestHelpers.InMethod();
370
351 LSL_Types.LSLFloat testFloat; 371 LSL_Types.LSLFloat testFloat;
352 372
353 foreach (KeyValuePair<string, double> number in m_stringDoubleSet) 373 foreach (KeyValuePair<string, double> number in m_stringDoubleSet)
@@ -363,6 +383,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
363 [Test] 383 [Test]
364 public void TestExplicitCastLSLStringToLSLFloat() 384 public void TestExplicitCastLSLStringToLSLFloat()
365 { 385 {
386 TestHelpers.InMethod();
387
366 LSL_Types.LSLFloat testFloat; 388 LSL_Types.LSLFloat testFloat;
367 389
368 foreach (KeyValuePair<string, double> number in m_stringDoubleSet) 390 foreach (KeyValuePair<string, double> number in m_stringDoubleSet)
@@ -378,6 +400,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
378 [Test] 400 [Test]
379 public void TestImplicitCastDoubleToLSLFloat() 401 public void TestImplicitCastDoubleToLSLFloat()
380 { 402 {
403 TestHelpers.InMethod();
404
381 LSL_Types.LSLFloat testFloat; 405 LSL_Types.LSLFloat testFloat;
382 406
383 foreach (double number in m_doubleList) 407 foreach (double number in m_doubleList)
@@ -393,6 +417,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
393 [Test] 417 [Test]
394 public void TestImplicitCastLSLFloatToDouble() 418 public void TestImplicitCastLSLFloatToDouble()
395 { 419 {
420 TestHelpers.InMethod();
421
396 double testNumber; 422 double testNumber;
397 LSL_Types.LSLFloat testFloat; 423 LSL_Types.LSLFloat testFloat;
398 424
@@ -411,19 +437,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
411 [Test] 437 [Test]
412 public void TestExplicitCastLSLFloatToFloat() 438 public void TestExplicitCastLSLFloatToFloat()
413 { 439 {
414 float testFloat; 440 TestHelpers.InMethod();
415 float numberAsFloat; 441
416 LSL_Types.LSLFloat testLSLFloat; 442 float testFloat;
417 foreach (double number in m_doubleList) 443 float numberAsFloat;
418 { 444 LSL_Types.LSLFloat testLSLFloat;
419 testLSLFloat = new LSL_Types.LSLFloat(number);
420 numberAsFloat = (float)number;
421 testFloat = (float)testLSLFloat;
422
423 Assert.That((double)testFloat, new DoubleToleranceConstraint((double)numberAsFloat, _lowPrecisionTolerance));
424 }
425 }
426 445
446 foreach (double number in m_doubleList)
447 {
448 testLSLFloat = new LSL_Types.LSLFloat(number);
449 numberAsFloat = (float)number;
450 testFloat = (float)testLSLFloat;
451
452 Assert.That((double)testFloat, new DoubleToleranceConstraint((double)numberAsFloat, _lowPrecisionTolerance));
453 }
454 }
427 455
428 /// <summary> 456 /// <summary>
429 /// Tests the equality (==) operator. 457 /// Tests the equality (==) operator.
@@ -431,6 +459,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
431 [Test] 459 [Test]
432 public void TestEqualsOperator() 460 public void TestEqualsOperator()
433 { 461 {
462 TestHelpers.InMethod();
463
434 LSL_Types.LSLFloat testFloatA, testFloatB; 464 LSL_Types.LSLFloat testFloatA, testFloatB;
435 465
436 foreach (double number in m_doubleList) 466 foreach (double number in m_doubleList)
@@ -450,6 +480,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
450 [Test] 480 [Test]
451 public void TestNotEqualOperator() 481 public void TestNotEqualOperator()
452 { 482 {
483 TestHelpers.InMethod();
484
453 LSL_Types.LSLFloat testFloatA, testFloatB; 485 LSL_Types.LSLFloat testFloatA, testFloatB;
454 486
455 foreach (double number in m_doubleList) 487 foreach (double number in m_doubleList)
@@ -469,6 +501,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
469 [Test] 501 [Test]
470 public void TestIncrementOperator() 502 public void TestIncrementOperator()
471 { 503 {
504 TestHelpers.InMethod();
505
472 LSL_Types.LSLFloat testFloat; 506 LSL_Types.LSLFloat testFloat;
473 double testNumber; 507 double testNumber;
474 508
@@ -493,6 +527,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
493 [Test] 527 [Test]
494 public void TestDecrementOperator() 528 public void TestDecrementOperator()
495 { 529 {
530 TestHelpers.InMethod();
531
496 LSL_Types.LSLFloat testFloat; 532 LSL_Types.LSLFloat testFloat;
497 double testNumber; 533 double testNumber;
498 534
@@ -517,6 +553,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
517 [Test] 553 [Test]
518 public void TestToString() 554 public void TestToString()
519 { 555 {
556 TestHelpers.InMethod();
557
520 LSL_Types.LSLFloat testFloat; 558 LSL_Types.LSLFloat testFloat;
521 559
522 foreach (KeyValuePair<double, string> number in m_doubleStringSet) 560 foreach (KeyValuePair<double, string> number in m_doubleStringSet)
@@ -532,6 +570,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
532 [Test] 570 [Test]
533 public void TestAddTwoLSLFloats() 571 public void TestAddTwoLSLFloats()
534 { 572 {
573 TestHelpers.InMethod();
574
535 LSL_Types.LSLFloat testResult; 575 LSL_Types.LSLFloat testResult;
536 576
537 foreach (KeyValuePair<double, double> number in m_doubleDoubleSet) 577 foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
@@ -547,6 +587,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
547 [Test] 587 [Test]
548 public void TestSubtractTwoLSLFloats() 588 public void TestSubtractTwoLSLFloats()
549 { 589 {
590 TestHelpers.InMethod();
591
550 LSL_Types.LSLFloat testResult; 592 LSL_Types.LSLFloat testResult;
551 593
552 foreach (KeyValuePair<double, double> number in m_doubleDoubleSet) 594 foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
@@ -562,6 +604,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
562 [Test] 604 [Test]
563 public void TestMultiplyTwoLSLFloats() 605 public void TestMultiplyTwoLSLFloats()
564 { 606 {
607 TestHelpers.InMethod();
608
565 LSL_Types.LSLFloat testResult; 609 LSL_Types.LSLFloat testResult;
566 610
567 foreach (KeyValuePair<double, double> number in m_doubleDoubleSet) 611 foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
@@ -577,6 +621,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
577 [Test] 621 [Test]
578 public void TestDivideTwoLSLFloats() 622 public void TestDivideTwoLSLFloats()
579 { 623 {
624 TestHelpers.InMethod();
625
580 LSL_Types.LSLFloat testResult; 626 LSL_Types.LSLFloat testResult;
581 627
582 foreach (KeyValuePair<double, double> number in m_doubleDoubleSet) 628 foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
@@ -595,6 +641,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
595 [Test] 641 [Test]
596 public void TestImplicitCastBooleanToLSLFloat() 642 public void TestImplicitCastBooleanToLSLFloat()
597 { 643 {
644 TestHelpers.InMethod();
645
598 LSL_Types.LSLFloat testFloat; 646 LSL_Types.LSLFloat testFloat;
599 647
600 testFloat = (1 == 0); 648 testFloat = (1 == 0);
@@ -610,4 +658,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
610 Assert.That(testFloat.value, new DoubleToleranceConstraint(1.0, _lowPrecisionTolerance)); 658 Assert.That(testFloat.value, new DoubleToleranceConstraint(1.0, _lowPrecisionTolerance));
611 } 659 }
612 } 660 }
613} 661} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs
index 3ad673b..8d1169a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs
@@ -79,6 +79,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
79 [Test] 79 [Test]
80 public void TestExplicitCastLSLFloatToLSLInteger() 80 public void TestExplicitCastLSLFloatToLSLInteger()
81 { 81 {
82 TestHelpers.InMethod();
83
82 LSL_Types.LSLInteger testInteger; 84 LSL_Types.LSLInteger testInteger;
83 85
84 foreach (KeyValuePair<double, int> number in m_doubleIntSet) 86 foreach (KeyValuePair<double, int> number in m_doubleIntSet)
@@ -94,6 +96,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
94 [Test] 96 [Test]
95 public void TestExplicitCastStringToLSLInteger() 97 public void TestExplicitCastStringToLSLInteger()
96 { 98 {
99 TestHelpers.InMethod();
100
97 LSL_Types.LSLInteger testInteger; 101 LSL_Types.LSLInteger testInteger;
98 102
99 foreach (KeyValuePair<string, int> number in m_stringIntSet) 103 foreach (KeyValuePair<string, int> number in m_stringIntSet)
@@ -109,6 +113,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
109 [Test] 113 [Test]
110 public void TestExplicitCastLSLStringToLSLInteger() 114 public void TestExplicitCastLSLStringToLSLInteger()
111 { 115 {
116 TestHelpers.InMethod();
117
112 LSL_Types.LSLInteger testInteger; 118 LSL_Types.LSLInteger testInteger;
113 119
114 foreach (KeyValuePair<string, int> number in m_stringIntSet) 120 foreach (KeyValuePair<string, int> number in m_stringIntSet)
@@ -124,6 +130,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
124 [Test] 130 [Test]
125 public void TestImplicitCastBooleanToLSLInteger() 131 public void TestImplicitCastBooleanToLSLInteger()
126 { 132 {
133 TestHelpers.InMethod();
134
127 LSL_Types.LSLInteger testInteger; 135 LSL_Types.LSLInteger testInteger;
128 136
129 testInteger = (1 == 0); 137 testInteger = (1 == 0);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLString.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLString.cs
index fa976ed..c4ca1a8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLString.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLString.cs
@@ -71,6 +71,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
71 [Test] 71 [Test]
72 public void TestConstructFromLSLFloat() 72 public void TestConstructFromLSLFloat()
73 { 73 {
74 TestHelpers.InMethod();
75
74 LSL_Types.LSLString testString; 76 LSL_Types.LSLString testString;
75 77
76 foreach (KeyValuePair<double, string> number in m_doubleStringSet) 78 foreach (KeyValuePair<double, string> number in m_doubleStringSet)
@@ -86,6 +88,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
86 [Test] 88 [Test]
87 public void TestExplicitCastLSLFloatToLSLString() 89 public void TestExplicitCastLSLFloatToLSLString()
88 { 90 {
91 TestHelpers.InMethod();
92
89 LSL_Types.LSLString testString; 93 LSL_Types.LSLString testString;
90 94
91 foreach (KeyValuePair<double, string> number in m_doubleStringSet) 95 foreach (KeyValuePair<double, string> number in m_doubleStringSet)
@@ -101,6 +105,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
101 [Test] 105 [Test]
102 public void TestExplicitCastLSLStringToQuaternion() 106 public void TestExplicitCastLSLStringToQuaternion()
103 { 107 {
108 TestHelpers.InMethod();
109
104 string quaternionString = "<0.00000, 0.70711, 0.00000, 0.70711>"; 110 string quaternionString = "<0.00000, 0.70711, 0.00000, 0.70711>";
105 LSL_Types.LSLString quaternionLSLString = new LSL_Types.LSLString(quaternionString); 111 LSL_Types.LSLString quaternionLSLString = new LSL_Types.LSLString(quaternionString);
106 112
@@ -118,6 +124,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
118 [Test] 124 [Test]
119 public void TestImplicitCastBooleanToLSLFloat() 125 public void TestImplicitCastBooleanToLSLFloat()
120 { 126 {
127 TestHelpers.InMethod();
128
121 LSL_Types.LSLString testString; 129 LSL_Types.LSLString testString;
122 130
123 testString = (LSL_Types.LSLString) (1 == 0); 131 testString = (LSL_Types.LSLString) (1 == 0);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestList.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestList.cs
index 66a7329..b81225f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestList.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestList.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
44 [Test] 44 [Test]
45 public void TestConcatenateString() 45 public void TestConcatenateString()
46 { 46 {
47 TestHelpers.InMethod();
48
47 LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test")); 49 LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test"));
48 testList += new LSL_Types.LSLString("addition"); 50 testList += new LSL_Types.LSLString("addition");
49 51
@@ -64,6 +66,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
64 [Test] 66 [Test]
65 public void TestConcatenateInteger() 67 public void TestConcatenateInteger()
66 { 68 {
69 TestHelpers.InMethod();
70
67 LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test")); 71 LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test"));
68 testList += new LSL_Types.LSLInteger(20); 72 testList += new LSL_Types.LSLInteger(20);
69 73
@@ -84,6 +88,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
84 [Test] 88 [Test]
85 public void TestConcatenateDouble() 89 public void TestConcatenateDouble()
86 { 90 {
91 TestHelpers.InMethod();
92
87 LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test")); 93 LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test"));
88 testList += new LSL_Types.LSLFloat(2.0f); 94 testList += new LSL_Types.LSLFloat(2.0f);
89 95
@@ -104,6 +110,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
104 [Test] 110 [Test]
105 public void TestCastLSLIntegerItemToLSLInteger() 111 public void TestCastLSLIntegerItemToLSLInteger()
106 { 112 {
113 TestHelpers.InMethod();
114
107 LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(123); 115 LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(123);
108 LSL_Types.list testList = new LSL_Types.list(testValue); 116 LSL_Types.list testList = new LSL_Types.list(testValue);
109 117
@@ -116,6 +124,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
116 [Test] 124 [Test]
117 public void TestCastLSLFloatItemToLSLFloat() 125 public void TestCastLSLFloatItemToLSLFloat()
118 { 126 {
127 TestHelpers.InMethod();
128
119 LSL_Types.LSLFloat testValue = new LSL_Types.LSLFloat(123.45678987); 129 LSL_Types.LSLFloat testValue = new LSL_Types.LSLFloat(123.45678987);
120 LSL_Types.list testList = new LSL_Types.list(testValue); 130 LSL_Types.list testList = new LSL_Types.list(testValue);
121 131
@@ -128,6 +138,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
128 [Test] 138 [Test]
129 public void TestCastLSLStringItemToLSLString() 139 public void TestCastLSLStringItemToLSLString()
130 { 140 {
141 TestHelpers.InMethod();
142
131 LSL_Types.LSLString testValue = new LSL_Types.LSLString("hello there"); 143 LSL_Types.LSLString testValue = new LSL_Types.LSLString("hello there");
132 LSL_Types.list testList = new LSL_Types.list(testValue); 144 LSL_Types.list testList = new LSL_Types.list(testValue);
133 145
@@ -140,6 +152,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
140 [Test] 152 [Test]
141 public void TestCastVector3ItemToVector3() 153 public void TestCastVector3ItemToVector3()
142 { 154 {
155 TestHelpers.InMethod();
156
143 LSL_Types.Vector3 testValue = new LSL_Types.Vector3(12.34, 56.987654, 0.00987); 157 LSL_Types.Vector3 testValue = new LSL_Types.Vector3(12.34, 56.987654, 0.00987);
144 LSL_Types.list testList = new LSL_Types.list(testValue); 158 LSL_Types.list testList = new LSL_Types.list(testValue);
145 159
@@ -151,6 +165,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
151 [Test] 165 [Test]
152 public void TestCastQuaternionItemToQuaternion() 166 public void TestCastQuaternionItemToQuaternion()
153 { 167 {
168 TestHelpers.InMethod();
169
154 LSL_Types.Quaternion testValue = new LSL_Types.Quaternion(12.34, 56.44323, 765.983421, 0.00987); 170 LSL_Types.Quaternion testValue = new LSL_Types.Quaternion(12.34, 56.44323, 765.983421, 0.00987);
155 LSL_Types.list testList = new LSL_Types.list(testValue); 171 LSL_Types.list testList = new LSL_Types.list(testValue);
156 172
@@ -165,6 +181,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
165 [Test] 181 [Test]
166 public void TestGetLSLIntegerItemForLSLIntegerItem() 182 public void TestGetLSLIntegerItemForLSLIntegerItem()
167 { 183 {
184 TestHelpers.InMethod();
185
168 LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(999911); 186 LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(999911);
169 LSL_Types.list testList = new LSL_Types.list(testValue); 187 LSL_Types.list testList = new LSL_Types.list(testValue);
170 188
@@ -177,6 +195,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
177 [Test] 195 [Test]
178 public void TestGetLSLFloatItemForLSLFloatItem() 196 public void TestGetLSLFloatItemForLSLFloatItem()
179 { 197 {
198 TestHelpers.InMethod();
199
180 LSL_Types.LSLFloat testValue = new LSL_Types.LSLFloat(321.45687876); 200 LSL_Types.LSLFloat testValue = new LSL_Types.LSLFloat(321.45687876);
181 LSL_Types.list testList = new LSL_Types.list(testValue); 201 LSL_Types.list testList = new LSL_Types.list(testValue);
182 202
@@ -189,11 +209,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
189 [Test] 209 [Test]
190 public void TestGetLSLFloatItemForLSLIntegerItem() 210 public void TestGetLSLFloatItemForLSLIntegerItem()
191 { 211 {
192 LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(3060987); 212 TestHelpers.InMethod();
193 LSL_Types.LSLFloat testFloatValue = new LSL_Types.LSLFloat(testValue); 213
194 LSL_Types.list testList = new LSL_Types.list(testValue); 214 LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(3060987);
215 LSL_Types.LSLFloat testFloatValue = new LSL_Types.LSLFloat(testValue);
216 LSL_Types.list testList = new LSL_Types.list(testValue);
195 217
196 Assert.AreEqual(testFloatValue, testList.GetLSLFloatItem(0)); 218 Assert.AreEqual(testFloatValue, testList.GetLSLFloatItem(0));
197 } 219 }
198 220
199 /// <summary> 221 /// <summary>
@@ -202,6 +224,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
202 [Test] 224 [Test]
203 public void TestGetLSLStringItemForLSLStringItem() 225 public void TestGetLSLStringItemForLSLStringItem()
204 { 226 {
227 TestHelpers.InMethod();
228
205 LSL_Types.LSLString testValue = new LSL_Types.LSLString("hello all"); 229 LSL_Types.LSLString testValue = new LSL_Types.LSLString("hello all");
206 LSL_Types.list testList = new LSL_Types.list(testValue); 230 LSL_Types.list testList = new LSL_Types.list(testValue);
207 231
@@ -214,6 +238,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
214 [Test] 238 [Test]
215 public void TestGetLSLStringItemForKeyItem() 239 public void TestGetLSLStringItemForKeyItem()
216 { 240 {
241 TestHelpers.InMethod();
242
217 LSL_Types.key testValue 243 LSL_Types.key testValue
218 = new LSL_Types.key("98000000-0000-2222-3333-100000001000"); 244 = new LSL_Types.key("98000000-0000-2222-3333-100000001000");
219 LSL_Types.LSLString testStringValue = new LSL_Types.LSLString(testValue); 245 LSL_Types.LSLString testStringValue = new LSL_Types.LSLString(testValue);
@@ -228,6 +254,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
228 [Test] 254 [Test]
229 public void TestGetVector3ItemForVector3Item() 255 public void TestGetVector3ItemForVector3Item()
230 { 256 {
257 TestHelpers.InMethod();
258
231 LSL_Types.Vector3 testValue = new LSL_Types.Vector3(92.34, 58.98754, -0.10987); 259 LSL_Types.Vector3 testValue = new LSL_Types.Vector3(92.34, 58.98754, -0.10987);
232 LSL_Types.list testList = new LSL_Types.list(testValue); 260 LSL_Types.list testList = new LSL_Types.list(testValue);
233 261
@@ -239,6 +267,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
239 [Test] 267 [Test]
240 public void TestGetQuaternionItemForQuaternionItem() 268 public void TestGetQuaternionItemForQuaternionItem()
241 { 269 {
270 TestHelpers.InMethod();
271
242 LSL_Types.Quaternion testValue = new LSL_Types.Quaternion(12.64, 59.43723, 765.3421, 4.00987); 272 LSL_Types.Quaternion testValue = new LSL_Types.Quaternion(12.64, 59.43723, 765.3421, 4.00987);
243 LSL_Types.list testList = new LSL_Types.list(testValue); 273 LSL_Types.list testList = new LSL_Types.list(testValue);
244 274
@@ -251,6 +281,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
251 [Test] 281 [Test]
252 public void TestGetKeyItemForKeyItem() 282 public void TestGetKeyItemForKeyItem()
253 { 283 {
284 TestHelpers.InMethod();
285
254 LSL_Types.key testValue 286 LSL_Types.key testValue
255 = new LSL_Types.key("00000000-0000-2222-3333-100000001012"); 287 = new LSL_Types.key("00000000-0000-2222-3333-100000001012");
256 LSL_Types.list testList = new LSL_Types.list(testValue); 288 LSL_Types.list testList = new LSL_Types.list(testValue);
@@ -258,4 +290,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
258 Assert.AreEqual(testValue, testList.GetKeyItem(0)); 290 Assert.AreEqual(testValue, testList.GetKeyItem(0));
259 } 291 }
260 } 292 }
261} 293} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestVector3.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestVector3.cs
index 195af7f..ebf8001 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestVector3.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestVector3.cs
@@ -32,16 +32,17 @@ using OpenSim.Region.ScriptEngine.Shared;
32 32
33namespace OpenSim.Region.ScriptEngine.Shared.Tests 33namespace OpenSim.Region.ScriptEngine.Shared.Tests
34{ 34{
35 /// <summary>
36 /// Tests for Vector3
37 /// </summary>
35 [TestFixture] 38 [TestFixture]
36 public class LSL_TypesTestVector3 39 public class LSL_TypesTestVector3
37 { 40 {
38 /// <summary>
39 /// Tests for Vector3
40 /// </summary>
41 [Test] 41 [Test]
42
43 public void TestDotProduct() 42 public void TestDotProduct()
44 { 43 {
44 TestHelpers.InMethod();
45
45 // The numbers we test for. 46 // The numbers we test for.
46 Dictionary<string, double> expectsSet = new Dictionary<string, double>(); 47 Dictionary<string, double> expectsSet = new Dictionary<string, double>();
47 expectsSet.Add("<1, 2, 3> * <2, 3, 4>", 20.0); 48 expectsSet.Add("<1, 2, 3> * <2, 3, 4>", 20.0);
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index c68f03f..b433430 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -49,7 +49,10 @@ using OpenSim.Region.ScriptEngine.Shared;
49using OpenSim.Region.ScriptEngine.Shared.ScriptBase; 49using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
50using OpenSim.Region.ScriptEngine.Shared.CodeTools; 50using OpenSim.Region.ScriptEngine.Shared.CodeTools;
51using OpenSim.Region.ScriptEngine.Shared.Instance; 51using OpenSim.Region.ScriptEngine.Shared.Instance;
52using OpenSim.Region.ScriptEngine.Shared.Api;
53using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
52using OpenSim.Region.ScriptEngine.Interfaces; 54using OpenSim.Region.ScriptEngine.Interfaces;
55using Timer = OpenSim.Region.ScriptEngine.Shared.Api.Plugins.Timer;
53 56
54using ScriptCompileQueue = OpenSim.Framework.LocklessQueue<object[]>; 57using ScriptCompileQueue = OpenSim.Framework.LocklessQueue<object[]>;
55 58
@@ -274,22 +277,22 @@ namespace OpenSim.Region.ScriptEngine.XEngine
274 } 277 }
275 278
276 MainConsole.Instance.Commands.AddCommand( 279 MainConsole.Instance.Commands.AddCommand(
277 "scripts", false, "xengine status", "xengine status", "Show status information", 280 "Scripts", false, "xengine status", "xengine status", "Show status information",
278 "Show status information on the script engine.", 281 "Show status information on the script engine.",
279 HandleShowStatus); 282 HandleShowStatus);
280 283
281 MainConsole.Instance.Commands.AddCommand( 284 MainConsole.Instance.Commands.AddCommand(
282 "scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information", 285 "Scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information",
283 "Show information on all scripts known to the script engine." 286 "Show information on all scripts known to the script engine."
284 + "If a <script-item-uuid> is given then only information on that script will be shown.", 287 + "If a <script-item-uuid> is given then only information on that script will be shown.",
285 HandleShowScripts); 288 HandleShowScripts);
286 289
287 MainConsole.Instance.Commands.AddCommand( 290 MainConsole.Instance.Commands.AddCommand(
288 "scripts", false, "show scripts", "show scripts [<script-item-uuid>]", "Show script information", 291 "Scripts", false, "show scripts", "show scripts [<script-item-uuid>]", "Show script information",
289 "Synonym for scripts show command", HandleShowScripts); 292 "Synonym for scripts show command", HandleShowScripts);
290 293
291 MainConsole.Instance.Commands.AddCommand( 294 MainConsole.Instance.Commands.AddCommand(
292 "scripts", false, "scripts suspend", "scripts suspend [<script-item-uuid>]", "Suspends all running scripts", 295 "Scripts", false, "scripts suspend", "scripts suspend [<script-item-uuid>]", "Suspends all running scripts",
293 "Suspends all currently running scripts. This only suspends event delivery, it will not suspend a" 296 "Suspends all currently running scripts. This only suspends event delivery, it will not suspend a"
294 + " script that is currently processing an event.\n" 297 + " script that is currently processing an event.\n"
295 + "Suspended scripts will continue to accumulate events but won't process them.\n" 298 + "Suspended scripts will continue to accumulate events but won't process them.\n"
@@ -297,20 +300,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine
297 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleSuspendScript)); 300 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleSuspendScript));
298 301
299 MainConsole.Instance.Commands.AddCommand( 302 MainConsole.Instance.Commands.AddCommand(
300 "scripts", false, "scripts resume", "scripts resume [<script-item-uuid>]", "Resumes all suspended scripts", 303 "Scripts", false, "scripts resume", "scripts resume [<script-item-uuid>]", "Resumes all suspended scripts",
301 "Resumes all currently suspended scripts.\n" 304 "Resumes all currently suspended scripts.\n"
302 + "Resumed scripts will process all events accumulated whilst suspended." 305 + "Resumed scripts will process all events accumulated whilst suspended."
303 + "If a <script-item-uuid> is given then only that script will be resumed. Otherwise, all suitable scripts are resumed.", 306 + "If a <script-item-uuid> is given then only that script will be resumed. Otherwise, all suitable scripts are resumed.",
304 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleResumeScript)); 307 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleResumeScript));
305 308
306 MainConsole.Instance.Commands.AddCommand( 309 MainConsole.Instance.Commands.AddCommand(
307 "scripts", false, "scripts stop", "scripts stop [<script-item-uuid>]", "Stops all running scripts", 310 "Scripts", false, "scripts stop", "scripts stop [<script-item-uuid>]", "Stops all running scripts",
308 "Stops all running scripts." 311 "Stops all running scripts."
309 + "If a <script-item-uuid> is given then only that script will be stopped. Otherwise, all suitable scripts are stopped.", 312 + "If a <script-item-uuid> is given then only that script will be stopped. Otherwise, all suitable scripts are stopped.",
310 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStopScript)); 313 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStopScript));
311 314
312 MainConsole.Instance.Commands.AddCommand( 315 MainConsole.Instance.Commands.AddCommand(
313 "scripts", false, "scripts start", "scripts start [<script-item-uuid>]", "Starts all stopped scripts", 316 "Scripts", false, "scripts start", "scripts start [<script-item-uuid>]", "Starts all stopped scripts",
314 "Starts all stopped scripts." 317 "Starts all stopped scripts."
315 + "If a <script-item-uuid> is given then only that script will be started. Otherwise, all suitable scripts are started.", 318 + "If a <script-item-uuid> is given then only that script will be started. Otherwise, all suitable scripts are started.",
316 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStartScript)); 319 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStartScript));
@@ -386,6 +389,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
386 sb.AppendFormat("Work items waiting : {0}\n", m_ThreadPool.WaitingCallbacks); 389 sb.AppendFormat("Work items waiting : {0}\n", m_ThreadPool.WaitingCallbacks);
387// sb.AppendFormat("Assemblies loaded : {0}\n", m_Assemblies.Count); 390// sb.AppendFormat("Assemblies loaded : {0}\n", m_Assemblies.Count);
388 391
392 SensorRepeat sr = AsyncCommandManager.GetSensorRepeatPlugin(this);
393 sb.AppendFormat("Sensors : {0}\n", sr.SensorsCount);
394
395 Dataserver ds = AsyncCommandManager.GetDataserverPlugin(this);
396 sb.AppendFormat("Dataserver requests : {0}\n", ds.DataserverRequestsCount);
397
398 Timer t = AsyncCommandManager.GetTimerPlugin(this);
399 sb.AppendFormat("Timers : {0}\n", t.TimersCount);
400
401 Listener l = AsyncCommandManager.GetListenerPlugin(this);
402 sb.AppendFormat("Listeners : {0}\n", l.ListenerCount);
403
389 MainConsole.Instance.OutputFormat(sb.ToString()); 404 MainConsole.Instance.OutputFormat(sb.ToString());
390 } 405 }
391 406