From 6ece8d86e051ffb58afd01d92ee780d98eca997a Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Thu, 13 Aug 2009 23:06:29 -0400 Subject: Deal with possible race in TestAddNeighborRegion in ScenePresenceTests --- .../Framework/Scenes/Tests/ScenePresenceTests.cs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 TestHelper.InMethod(); string reason; + + if (acd1 == null) + fixNullPresence(); + scene.NewUserConnection(acd1, out reason); + if (testclient == null) + testclient = new TestClient(acd1, scene); scene.AddNewClient(testclient); ScenePresence presence = scene.GetScenePresence(agent1); @@ -162,6 +168,24 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(neighbours.Count, Is.EqualTo(2)); } + public void fixNullPresence() + { + string firstName = "testfirstname"; + + AgentCircuitData agent = new AgentCircuitData(); + agent.AgentID = agent1; + agent.firstname = firstName; + agent.lastname = "testlastname"; + agent.SessionID = UUID.Zero; + agent.SecureSessionID = UUID.Zero; + agent.circuitcode = 123; + agent.BaseFolder = UUID.Zero; + agent.InventoryFolder = UUID.Zero; + agent.startpos = Vector3.Zero; + agent.CapsPath = GetRandomCapsObjectPath(); + + acd1 = agent; + } [Test] public void T013_TestRemoveNeighbourRegion() -- cgit v1.1