aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests')
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs33
1 files changed, 31 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
index 2636473..a1d30f3 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
53 } 53 }
54 54
55 [Test] 55 [Test]
56 public void TestSitOutsideRange() 56 public void TestSitOutsideRangeNoTarget()
57 { 57 {
58 TestHelpers.InMethod(); 58 TestHelpers.InMethod();
59// log4net.Config.XmlConfigurator.Configure(); 59// log4net.Config.XmlConfigurator.Configure();
@@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
73 } 73 }
74 74
75 [Test] 75 [Test]
76 public void TestSitWithinRange() 76 public void TestSitWithinRangeNoTarget()
77 { 77 {
78 TestHelpers.InMethod(); 78 TestHelpers.InMethod();
79// log4net.Config.XmlConfigurator.Configure(); 79// log4net.Config.XmlConfigurator.Configure();
@@ -124,5 +124,34 @@ namespace OpenSim.Region.Framework.Scenes.Tests
124 Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero)); 124 Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero));
125 Assert.That(sp.ParentID, Is.EqualTo(0)); 125 Assert.That(sp.ParentID, Is.EqualTo(0));
126 } 126 }
127
128 [Test]
129 public void TestSitAndStandWithSitTarget()
130 {
131 TestHelpers.InMethod();
132// log4net.Config.XmlConfigurator.Configure();
133
134 ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1));
135
136 // If a prim has a sit target then we can sit from any distance away
137 Vector3 startPos = new Vector3(128, 128, 30);
138 sp.AbsolutePosition = startPos;
139
140 SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene);
141 part.SitTargetPosition = new Vector3(0, 0, 1);
142
143 sp.HandleAgentRequestSit(sp.ControllingClient, sp.UUID, part.UUID, Vector3.Zero);
144
145 Assert.That(part.SitTargetAvatar, Is.EqualTo(sp.UUID));
146 Assert.That(sp.ParentID, Is.EqualTo(part.LocalId));
147 Assert.That(
148 sp.AbsolutePosition,
149 Is.EqualTo(part.AbsolutePosition + part.SitTargetPosition + ScenePresence.SIT_TARGET_ADJUSTMENT));
150
151 sp.StandUp();
152
153 Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero));
154 Assert.That(sp.ParentID, Is.EqualTo(0));
155 }
127 } 156 }
128} \ No newline at end of file 157} \ No newline at end of file