aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Tests
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-03 18:48:04 +0000
committerJustin Clarke Casey2009-02-03 18:48:04 +0000
commitb2de0a3ae6e49e07d6f658ec55b8260ab5748627 (patch)
treebe4142ed318cd83f56b71fa2f5b0aced78f355bc /OpenSim/Region/Environment/Scenes/Tests
parent* Lock parts while they're being duplicated to prevent possible race conditio... (diff)
downloadopensim-SC-b2de0a3ae6e49e07d6f658ec55b8260ab5748627.zip
opensim-SC-b2de0a3ae6e49e07d6f658ec55b8260ab5748627.tar.gz
opensim-SC-b2de0a3ae6e49e07d6f658ec55b8260ab5748627.tar.bz2
opensim-SC-b2de0a3ae6e49e07d6f658ec55b8260ab5748627.tar.xz
* Now clearing parts list in the old group after a link has occurred
* Adjusted existing link tests to reflect this and added some new assertions
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Tests')
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs17
1 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
index ed2eb79..5e5f5c2 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
@@ -131,7 +131,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
131 // FIXME: Can't to these tests yet since group 2 still has the parts attached! We can't yet detach since 131 // FIXME: Can't to these tests yet since group 2 still has the parts attached! We can't yet detach since
132 // it might cause SOG.ProcessBackup() to fail due to the race condition. This really needs to be fixed. 132 // it might cause SOG.ProcessBackup() to fail due to the race condition. This really needs to be fixed.
133 //Assert.That(grp2.IsDeleted, "SOG 2 was not registered as deleted after link."); 133 //Assert.That(grp2.IsDeleted, "SOG 2 was not registered as deleted after link.");
134 //Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained children after delink."); 134 Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained children after delink.");
135 Assert.That(grp1.Children.Count == 2); 135 Assert.That(grp1.Children.Count == 2);
136 136
137 if (debugtest) 137 if (debugtest)
@@ -173,6 +173,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
173 if (debugtest) 173 if (debugtest)
174 System.Console.WriteLine("Group2: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset); 174 System.Console.WriteLine("Group2: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset);
175 175
176 Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink.");
176 Assert.That(part2.AbsolutePosition == Vector3.Zero); 177 Assert.That(part2.AbsolutePosition == Vector3.Zero);
177 } 178 }
178 179
@@ -224,10 +225,11 @@ namespace OpenSim.Region.Environment.Scenes.Tests
224 grp1.RootPart.UpdateFlag = 0; 225 grp1.RootPart.UpdateFlag = 0;
225 grp3.RootPart.UpdateFlag = 0; 226 grp3.RootPart.UpdateFlag = 0;
226 227
227 // At this point we should have 4 parts total in two groups. 228 // At this point we should have 4 parts total in two groups.
228
229 Assert.That(grp1.Children.Count == 2); 229 Assert.That(grp1.Children.Count == 2);
230 Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink.");
230 Assert.That(grp3.Children.Count == 2); 231 Assert.That(grp3.Children.Count == 2);
232 Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink.");
231 233
232 if (debugtest) 234 if (debugtest)
233 { 235 {
@@ -268,13 +270,12 @@ namespace OpenSim.Region.Environment.Scenes.Tests
268 270
269 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); 271 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f));
270 272
271 // Now we're linking the first group to the second group. This will make the first group child parts of the second one. 273 // Now we're linking the first group to the third group. This will make the first group child parts of the third one.
272 grp3.LinkToGroup(grp1); 274 grp3.LinkToGroup(grp1);
273 275
274 // Delink part 2 276 // Delink parts 2 and 3
275 grp1.DelinkFromGroup(part2.LocalId); 277 grp3.DelinkFromGroup(part2.LocalId);
276 278 grp3.DelinkFromGroup(part3.LocalId);
277 grp1.DelinkFromGroup(part3.LocalId);
278 279
279 if (debugtest) 280 if (debugtest)
280 { 281 {