aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-19 21:54:50 +0100
committerJustin Clark-Casey (justincc)2012-07-19 21:54:50 +0100
commite9a121e1b203e8880bcaf85d35612fc6706b281a (patch)
tree70eb7b09b1b25f432bf4f7e47c684b68cb849126 /OpenSim
parentAdd basic TestCreateRootScenePresence() regression test (diff)
downloadopensim-SC-e9a121e1b203e8880bcaf85d35612fc6706b281a.zip
opensim-SC-e9a121e1b203e8880bcaf85d35612fc6706b281a.tar.gz
opensim-SC-e9a121e1b203e8880bcaf85d35612fc6706b281a.tar.bz2
opensim-SC-e9a121e1b203e8880bcaf85d35612fc6706b281a.tar.xz
Add TestCreateDuplicateRootScenePresence() regression test.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs23
3 files changed, 41 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6d8ee7b..36452de 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4470,6 +4470,23 @@ namespace OpenSim.Region.Framework.Scenes
4470 } 4470 }
4471 4471
4472 /// <summary> 4472 /// <summary>
4473 /// Gets all the scene presences in this scene.
4474 /// </summary>
4475 /// <remarks>
4476 /// This method will return both root and child scene presences.
4477 ///
4478 /// Consider using ForEachScenePresence() or ForEachRootScenePresence() if possible since these will not
4479 /// involving creating a new List object.
4480 /// </remarks>
4481 /// <returns>
4482 /// A list of the scene presences. Adding or removing from the list will not affect the presences in the scene.
4483 /// </returns>
4484 public List<ScenePresence> GetScenePresences()
4485 {
4486 return new List<ScenePresence>(m_sceneGraph.GetScenePresences());
4487 }
4488
4489 /// <summary>
4473 /// Performs action on all avatars in the scene (root scene presences) 4490 /// Performs action on all avatars in the scene (root scene presences)
4474 /// Avatars may be an NPC or a 'real' client. 4491 /// Avatars may be an NPC or a 'real' client.
4475 /// </summary> 4492 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 2be5364..ba68dfa 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -768,7 +768,7 @@ namespace OpenSim.Region.Framework.Scenes
768 /// pass a delegate to ForEachScenePresence. 768 /// pass a delegate to ForEachScenePresence.
769 /// </summary> 769 /// </summary>
770 /// <returns></returns> 770 /// <returns></returns>
771 private List<ScenePresence> GetScenePresences() 771 protected internal List<ScenePresence> GetScenePresences()
772 { 772 {
773 return m_scenePresenceArray; 773 return m_scenePresenceArray;
774 } 774 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
index 44c1396..5758869 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
@@ -107,6 +107,29 @@ namespace OpenSim.Region.Framework.Scenes.Tests
107 Assert.That(sp, Is.Not.Null); 107 Assert.That(sp, Is.Not.Null);
108 Assert.That(sp.IsChildAgent, Is.False); 108 Assert.That(sp.IsChildAgent, Is.False);
109 Assert.That(sp.UUID, Is.EqualTo(spUuid)); 109 Assert.That(sp.UUID, Is.EqualTo(spUuid));
110
111 Assert.That(scene.GetScenePresences().Count, Is.EqualTo(1));
112 }
113
114 [Test]
115 public void TestCreateDuplicateRootScenePresence()
116 {
117 TestHelpers.InMethod();
118// TestHelpers.EnableLogging();
119
120 UUID spUuid = TestHelpers.ParseTail(0x1);
121
122 TestScene scene = new SceneHelpers().SetupScene();
123 SceneHelpers.AddScenePresence(scene, spUuid);
124 SceneHelpers.AddScenePresence(scene, spUuid);
125
126 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(spUuid), Is.Not.Null);
127 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
128
129 ScenePresence sp = scene.GetScenePresence(spUuid);
130 Assert.That(sp, Is.Not.Null);
131 Assert.That(sp.IsChildAgent, Is.False);
132 Assert.That(sp.UUID, Is.EqualTo(spUuid));
110 } 133 }
111 134
112 [Test] 135 [Test]