diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-13 23:06:29 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-13 23:06:29 -0400 |
commit | 6ece8d86e051ffb58afd01d92ee780d98eca997a (patch) | |
tree | c6d5594c7da3d8001bd0337a03b037c66ca3b38e | |
parent | Merge branch 'master' of ssh://MyConnection/var/git/opensim (diff) | |
download | opensim-SC_OLD-6ece8d86e051ffb58afd01d92ee780d98eca997a.zip opensim-SC_OLD-6ece8d86e051ffb58afd01d92ee780d98eca997a.tar.gz opensim-SC_OLD-6ece8d86e051ffb58afd01d92ee780d98eca997a.tar.bz2 opensim-SC_OLD-6ece8d86e051ffb58afd01d92ee780d98eca997a.tar.xz |
Deal with possible race in TestAddNeighborRegion in ScenePresenceTests
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 1836447..a3672d5 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | |||
@@ -147,7 +147,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
147 | TestHelper.InMethod(); | 147 | TestHelper.InMethod(); |
148 | 148 | ||
149 | string reason; | 149 | string reason; |
150 | |||
151 | if (acd1 == null) | ||
152 | fixNullPresence(); | ||
153 | |||
150 | scene.NewUserConnection(acd1, out reason); | 154 | scene.NewUserConnection(acd1, out reason); |
155 | if (testclient == null) | ||
156 | testclient = new TestClient(acd1, scene); | ||
151 | scene.AddNewClient(testclient); | 157 | scene.AddNewClient(testclient); |
152 | 158 | ||
153 | ScenePresence presence = scene.GetScenePresence(agent1); | 159 | ScenePresence presence = scene.GetScenePresence(agent1); |
@@ -162,6 +168,24 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
162 | 168 | ||
163 | Assert.That(neighbours.Count, Is.EqualTo(2)); | 169 | Assert.That(neighbours.Count, Is.EqualTo(2)); |
164 | } | 170 | } |
171 | public void fixNullPresence() | ||
172 | { | ||
173 | string firstName = "testfirstname"; | ||
174 | |||
175 | AgentCircuitData agent = new AgentCircuitData(); | ||
176 | agent.AgentID = agent1; | ||
177 | agent.firstname = firstName; | ||
178 | agent.lastname = "testlastname"; | ||
179 | agent.SessionID = UUID.Zero; | ||
180 | agent.SecureSessionID = UUID.Zero; | ||
181 | agent.circuitcode = 123; | ||
182 | agent.BaseFolder = UUID.Zero; | ||
183 | agent.InventoryFolder = UUID.Zero; | ||
184 | agent.startpos = Vector3.Zero; | ||
185 | agent.CapsPath = GetRandomCapsObjectPath(); | ||
186 | |||
187 | acd1 = agent; | ||
188 | } | ||
165 | 189 | ||
166 | [Test] | 190 | [Test] |
167 | public void T013_TestRemoveNeighbourRegion() | 191 | public void T013_TestRemoveNeighbourRegion() |