diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index 3e0f48f..b5dbb38 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | |||
@@ -36,6 +36,8 @@ using OpenSim.Region.Communications.Local; | |||
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Tests.Common.Mock; | 37 | using OpenSim.Tests.Common.Mock; |
38 | using OpenSim.Tests.Common.Setup; | 38 | using OpenSim.Tests.Common.Setup; |
39 | using log4net; | ||
40 | using System.Reflection; | ||
39 | 41 | ||
40 | namespace OpenSim.Region.CoreModules.Scenes.Tests | 42 | namespace OpenSim.Region.CoreModules.Scenes.Tests |
41 | { | 43 | { |
@@ -45,6 +47,8 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests | |||
45 | [TestFixture] | 47 | [TestFixture] |
46 | public class SceneObjectLinkingTests | 48 | public class SceneObjectLinkingTests |
47 | { | 49 | { |
50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
51 | |||
48 | [Test] | 52 | [Test] |
49 | public void TestLinkDelink2SceneObjects() | 53 | public void TestLinkDelink2SceneObjects() |
50 | { | 54 | { |
@@ -80,10 +84,10 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests | |||
80 | 84 | ||
81 | if (debugtest) | 85 | if (debugtest) |
82 | { | 86 | { |
83 | System.Console.WriteLine("parts: {0}", grp1.Children.Count); | 87 | m_log.Debug("parts: " + grp1.Children.Count); |
84 | System.Console.WriteLine("Group1: Pos:{0}, Rot:{1}", grp1.AbsolutePosition, grp1.Rotation); | 88 | m_log.Debug("Group1: Pos:"+grp1.AbsolutePosition+", Rot:"+grp1.Rotation); |
85 | System.Console.WriteLine("Group1: Prim1: OffsetPosition:{0}, OffsetRotation:{1}", part1.OffsetPosition, part1.RotationOffset); | 89 | m_log.Debug("Group1: Prim1: OffsetPosition:"+ part1.OffsetPosition+", OffsetRotation:"+part1.RotationOffset); |
86 | System.Console.WriteLine("Group1: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.OffsetPosition, part2.RotationOffset); | 90 | m_log.Debug("Group1: Prim2: OffsetPosition:"+part2.OffsetPosition+", OffsetRotation:"+part2.RotationOffset); |
87 | } | 91 | } |
88 | 92 | ||
89 | // root part should have no offset position or rotation | 93 | // root part should have no offset position or rotation |
@@ -101,13 +105,13 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests | |||
101 | Vector3 rotEuler1 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); | 105 | Vector3 rotEuler1 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); |
102 | 106 | ||
103 | if (debugtest) | 107 | if (debugtest) |
104 | System.Console.WriteLine(rotEuler1); | 108 | m_log.Debug(rotEuler1); |
105 | 109 | ||
106 | part2.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); | 110 | part2.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); |
107 | Vector3 rotEuler2 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); | 111 | Vector3 rotEuler2 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); |
108 | 112 | ||
109 | if (debugtest) | 113 | if (debugtest) |
110 | System.Console.WriteLine(rotEuler2); | 114 | m_log.Debug(rotEuler2); |
111 | 115 | ||
112 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); | 116 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); |
113 | 117 | ||
@@ -115,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests | |||
115 | grp1.DelinkFromGroup(part2.LocalId); | 119 | grp1.DelinkFromGroup(part2.LocalId); |
116 | 120 | ||
117 | if (debugtest) | 121 | if (debugtest) |
118 | System.Console.WriteLine("Group2: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset); | 122 | m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset); |
119 | 123 | ||
120 | Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink."); | 124 | Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink."); |
121 | Assert.That(part2.AbsolutePosition == Vector3.Zero); | 125 | Assert.That(part2.AbsolutePosition == Vector3.Zero); |
@@ -175,16 +179,16 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests | |||
175 | 179 | ||
176 | if (debugtest) | 180 | if (debugtest) |
177 | { | 181 | { |
178 | System.Console.WriteLine("--------After Link-------"); | 182 | m_log.Debug("--------After Link-------"); |
179 | System.Console.WriteLine("Group1: parts: {0}", grp1.Children.Count); | 183 | m_log.Debug("Group1: parts:" + grp1.Children.Count); |
180 | System.Console.WriteLine("Group1: Pos:{0}, Rot:{1}", grp1.AbsolutePosition, grp1.Rotation); | 184 | m_log.Debug("Group1: Pos:"+grp1.AbsolutePosition+", Rot:"+grp1.Rotation); |
181 | System.Console.WriteLine("Group1: Prim1: OffsetPosition:{0}, OffsetRotation:{1}", part1.OffsetPosition, part1.RotationOffset); | 185 | m_log.Debug("Group1: Prim1: OffsetPosition:" + part1.OffsetPosition + ", OffsetRotation:" + part1.RotationOffset); |
182 | System.Console.WriteLine("Group1: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.OffsetPosition, part2.RotationOffset); | 186 | m_log.Debug("Group1: Prim2: OffsetPosition:"+part2.OffsetPosition+", OffsetRotation:"+ part2.RotationOffset); |
183 | 187 | ||
184 | System.Console.WriteLine("Group3: parts: {0}", grp3.Children.Count); | 188 | m_log.Debug("Group3: parts:"+grp3.Children.Count); |
185 | System.Console.WriteLine("Group3: Pos:{0}, Rot:{1}", grp3.AbsolutePosition, grp3.Rotation); | 189 | m_log.Debug("Group3: Pos:"+grp3.AbsolutePosition+", Rot:"+grp3.Rotation); |
186 | System.Console.WriteLine("Group3: Prim1: OffsetPosition:{0}, OffsetRotation:{1}", part3.OffsetPosition, part3.RotationOffset); | 190 | m_log.Debug("Group3: Prim1: OffsetPosition:"+part3.OffsetPosition+", OffsetRotation:"+part3.RotationOffset); |
187 | System.Console.WriteLine("Group3: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part4.OffsetPosition, part4.RotationOffset); | 191 | m_log.Debug("Group3: Prim2: OffsetPosition:"+part4.OffsetPosition+", OffsetRotation:"+part4.RotationOffset); |
188 | } | 192 | } |
189 | 193 | ||
190 | // Required for linking | 194 | // Required for linking |
@@ -206,13 +210,13 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests | |||
206 | Vector3 rotEuler1 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); | 210 | Vector3 rotEuler1 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); |
207 | 211 | ||
208 | if (debugtest) | 212 | if (debugtest) |
209 | System.Console.WriteLine(rotEuler1); | 213 | m_log.Debug(rotEuler1); |
210 | 214 | ||
211 | part2.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); | 215 | part2.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); |
212 | Vector3 rotEuler2 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); | 216 | Vector3 rotEuler2 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); |
213 | 217 | ||
214 | if (debugtest) | 218 | if (debugtest) |
215 | System.Console.WriteLine(rotEuler2); | 219 | m_log.Debug(rotEuler2); |
216 | 220 | ||
217 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); | 221 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); |
218 | 222 | ||
@@ -225,16 +229,16 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests | |||
225 | 229 | ||
226 | if (debugtest) | 230 | if (debugtest) |
227 | { | 231 | { |
228 | System.Console.WriteLine("--------After De-Link-------"); | 232 | m_log.Debug("--------After De-Link-------"); |
229 | System.Console.WriteLine("Group1: parts: {0}", grp1.Children.Count); | 233 | m_log.Debug("Group1: parts:" + grp1.Children.Count); |
230 | System.Console.WriteLine("Group1: Pos:{0}, Rot:{1}", grp1.AbsolutePosition, grp1.Rotation); | 234 | m_log.Debug("Group1: Pos:" + grp1.AbsolutePosition + ", Rot:" + grp1.Rotation); |
231 | System.Console.WriteLine("Group1: Prim1: OffsetPosition:{0}, OffsetRotation:{1}", part1.OffsetPosition, part1.RotationOffset); | 235 | m_log.Debug("Group1: Prim1: OffsetPosition:" + part1.OffsetPosition + ", OffsetRotation:" + part1.RotationOffset); |
232 | System.Console.WriteLine("NoGroup: Prim2: AbsolutePosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset); | 236 | m_log.Debug("Group1: Prim2: OffsetPosition:" + part2.OffsetPosition + ", OffsetRotation:" + part2.RotationOffset); |
233 | 237 | ||
234 | System.Console.WriteLine("Group3: parts: {0}", grp3.Children.Count); | 238 | m_log.Debug("Group3: parts:" + grp3.Children.Count); |
235 | System.Console.WriteLine("Group3: Pos:{0}, Rot:{1}", grp3.AbsolutePosition, grp3.Rotation); | 239 | m_log.Debug("Group3: Pos:" + grp3.AbsolutePosition + ", Rot:" + grp3.Rotation); |
236 | System.Console.WriteLine("Group3: Prim1: OffsetPosition:{0}, OffsetRotation:{1}", part3.OffsetPosition, part3.RotationOffset); | 240 | m_log.Debug("Group3: Prim1: OffsetPosition:" + part3.OffsetPosition + ", OffsetRotation:" + part3.RotationOffset); |
237 | System.Console.WriteLine("Group3: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part4.OffsetPosition, part4.RotationOffset); | 241 | m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset); |
238 | } | 242 | } |
239 | 243 | ||
240 | Assert.That(part2.AbsolutePosition == Vector3.Zero); | 244 | Assert.That(part2.AbsolutePosition == Vector3.Zero); |