diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index b3d10df..709cca2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | |||
@@ -94,10 +94,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
94 | } | 94 | } |
95 | 95 | ||
96 | // root part should have no offset position or rotation | 96 | // root part should have no offset position or rotation |
97 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity); | 97 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, |
98 | "root part should have no offset position or rotation"); | ||
98 | 99 | ||
99 | // offset position should be root part position - part2.absolute position. | 100 | // offset position should be root part position - part2.absolute position. |
100 | Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10)); | 101 | Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10), |
102 | "offset position should be root part position - part2.absolute position."); | ||
101 | 103 | ||
102 | float roll = 0; | 104 | float roll = 0; |
103 | float pitch = 0; | 105 | float pitch = 0; |
@@ -116,7 +118,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
116 | if (debugtest) | 118 | if (debugtest) |
117 | m_log.Debug(rotEuler2); | 119 | m_log.Debug(rotEuler2); |
118 | 120 | ||
119 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); | 121 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f), |
122 | "Not exactly sure what this is asserting..."); | ||
120 | 123 | ||
121 | // Delink part 2 | 124 | // Delink part 2 |
122 | grp1.DelinkFromGroup(part2.LocalId); | 125 | grp1.DelinkFromGroup(part2.LocalId); |
@@ -125,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
125 | m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset); | 128 | m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset); |
126 | 129 | ||
127 | Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink."); | 130 | Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink."); |
128 | Assert.That(part2.AbsolutePosition == Vector3.Zero); | 131 | Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero"); |
129 | } | 132 | } |
130 | 133 | ||
131 | [Test] | 134 | [Test] |
@@ -175,10 +178,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
175 | grp3.LinkToGroup(grp4); | 178 | grp3.LinkToGroup(grp4); |
176 | 179 | ||
177 | // At this point we should have 4 parts total in two groups. | 180 | // At this point we should have 4 parts total in two groups. |
178 | Assert.That(grp1.Children.Count == 2); | 181 | Assert.That(grp1.Children.Count == 2, "Group1 children count should be 2"); |
179 | Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); | 182 | Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); |
180 | Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink."); | 183 | Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink."); |
181 | Assert.That(grp3.Children.Count == 2); | 184 | Assert.That(grp3.Children.Count == 2, "Group3 children count should be 2"); |
182 | Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); | 185 | Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); |
183 | Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink."); | 186 | Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink."); |
184 | 187 | ||
@@ -201,10 +204,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
201 | grp3.RootPart.UpdateFlag = 0; | 204 | grp3.RootPart.UpdateFlag = 0; |
202 | 205 | ||
203 | // root part should have no offset position or rotation | 206 | // root part should have no offset position or rotation |
204 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity); | 207 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, |
208 | "root part should have no offset position or rotation (again)"); | ||
205 | 209 | ||
206 | // offset position should be root part position - part2.absolute position. | 210 | // offset position should be root part position - part2.absolute position. |
207 | Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10)); | 211 | Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10), |
212 | "offset position should be root part position - part2.absolute position (again)"); | ||
208 | 213 | ||
209 | float roll = 0; | 214 | float roll = 0; |
210 | float pitch = 0; | 215 | float pitch = 0; |
@@ -223,7 +228,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
223 | if (debugtest) | 228 | if (debugtest) |
224 | m_log.Debug(rotEuler2); | 229 | m_log.Debug(rotEuler2); |
225 | 230 | ||
226 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); | 231 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f), |
232 | "Not sure what this assertion is all about..."); | ||
227 | 233 | ||
228 | // Now we're linking the first group to the third group. This will make the first group child parts of the third one. | 234 | // Now we're linking the first group to the third group. This will make the first group child parts of the third one. |
229 | grp3.LinkToGroup(grp1); | 235 | grp3.LinkToGroup(grp1); |
@@ -246,13 +252,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
246 | m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset); | 252 | m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset); |
247 | } | 253 | } |
248 | 254 | ||
249 | Assert.That(part2.AbsolutePosition == Vector3.Zero); | 255 | Assert.That(part2.AbsolutePosition == Vector3.Zero, "Badness 1"); |
250 | Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20)); | 256 | Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20), "Badness 2"); |
251 | Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f); | 257 | Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f); |
252 | Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003) | 258 | Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003) |
253 | && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) | 259 | && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) |
254 | && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) | 260 | && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) |
255 | && (part4.RotationOffset.W - compareQuaternion.W < 0.00003)); | 261 | && (part4.RotationOffset.W - compareQuaternion.W < 0.00003), |
262 | "Badness 3"); | ||
256 | } | 263 | } |
257 | } | 264 | } |
258 | } | 265 | } |