aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2015-11-19 02:46:25 +0000
committerUbitUmarov2015-11-19 02:46:25 +0000
commit8505ca88dd20a7c6c818b27a2d5430eb0cbb13e8 (patch)
treee256a1a4400d90821d29f7c668d66081c4f30154
parent work around some 'tests' errors: reset the event at start of new test. (diff)
downloadopensim-SC_OLD-8505ca88dd20a7c6c818b27a2d5430eb0cbb13e8.zip
opensim-SC_OLD-8505ca88dd20a7c6c818b27a2d5430eb0cbb13e8.tar.gz
opensim-SC_OLD-8505ca88dd20a7c6c818b27a2d5430eb0cbb13e8.tar.bz2
opensim-SC_OLD-8505ca88dd20a7c6c818b27a2d5430eb0cbb13e8.tar.xz
work around some 'tests' errors: use one autoresetevent per scene
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineCrossingTests.cs14
1 files changed, 9 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineCrossingTests.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineCrossingTests.cs
index b956d25..9037277 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineCrossingTests.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineCrossingTests.cs
@@ -162,6 +162,7 @@ default
162 162
163 EventParams ep = new EventParams("touch_start", new Object[] { new LSL_Types.LSLInteger(1) }, det); 163 EventParams ep = new EventParams("touch_start", new Object[] { new LSL_Types.LSLInteger(1) }, det);
164 164
165 messageReceived = null;
165 chatEvent.Reset(); 166 chatEvent.Reset();
166 xEngineA.PostObjectEvent(soSceneA.LocalId, ep); 167 xEngineA.PostObjectEvent(soSceneA.LocalId, ep);
167 chatEvent.WaitOne(60000); 168 chatEvent.WaitOne(60000);
@@ -169,13 +170,15 @@ default
169 Assert.That(messageReceived.Message, Is.EqualTo("1")); 170 Assert.That(messageReceived.Message, Is.EqualTo("1"));
170 } 171 }
171 172
172 sceneB.EventManager.OnChatFromWorld += (s, m) => { messageReceived = m; chatEvent.Set(); }; 173 AutoResetEvent chatEventB = new AutoResetEvent(false);
174 sceneB.EventManager.OnChatFromWorld += (s, m) => { messageReceived = m; chatEventB.Set(); };
173 175
174 chatEvent.Reset(); 176 messageReceived = null;
177 chatEventB.Reset();
175 // Cross with a negative value 178 // Cross with a negative value
176 soSceneA.AbsolutePosition = new Vector3(128, -10, 20); 179 soSceneA.AbsolutePosition = new Vector3(128, -10, 20);
177 180
178 chatEvent.WaitOne(60000); 181 chatEventB.WaitOne(60000);
179 Assert.That(messageReceived, Is.Not.Null, "No Changed message received."); 182 Assert.That(messageReceived, Is.Not.Null, "No Changed message received.");
180 Assert.That(messageReceived.Message, Is.Not.Null, "Changed message without content"); 183 Assert.That(messageReceived.Message, Is.Not.Null, "Changed message without content");
181 Assert.That(messageReceived.Message, Is.EqualTo("Changed")); 184 Assert.That(messageReceived.Message, Is.EqualTo("Changed"));
@@ -193,9 +196,10 @@ default
193 196
194 EventParams ep = new EventParams("touch_start", new Object[] { new LSL_Types.LSLInteger(1) }, det); 197 EventParams ep = new EventParams("touch_start", new Object[] { new LSL_Types.LSLInteger(1) }, det);
195 198
196 chatEvent.Reset(); 199 messageReceived = null;
200 chatEventB.Reset();
197 xEngineB.PostObjectEvent(soSceneB.LocalId, ep); 201 xEngineB.PostObjectEvent(soSceneB.LocalId, ep);
198 chatEvent.WaitOne(60000); 202 chatEventB.WaitOne(60000);
199 203
200 Assert.That(messageReceived.Message, Is.EqualTo("2")); 204 Assert.That(messageReceived.Message, Is.EqualTo("2"));
201 } 205 }