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(+) (limited to 'OpenSim/Region/Framework') 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 From dce81225c50e9ce15187bfb412870716127a31fa Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 14 Aug 2009 14:15:49 -0400 Subject: * allocate the dictionary for AgentCircuitData.ChildrenCapSeeds when creating the circuitdata object to see if it's the cause of a null reference exception in the TestAddNeighbourRegio test --- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index a3672d5..88452d2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -113,6 +113,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests agent.InventoryFolder = UUID.Zero; agent.startpos = Vector3.Zero; agent.CapsPath = GetRandomCapsObjectPath(); + agent.ChildrenCapSeeds = new Dictionary(); string reason; scene.NewUserConnection(agent, out reason); -- cgit v1.1