diff options
author | Justin Clark-Casey (justincc) | 2013-05-09 18:53:34 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-05-09 18:53:34 +0100 |
commit | b4a6f2195d6d1a3a5f91715f7badf4cc983f7689 (patch) | |
tree | 508431b5b41666d278e4f9e827fee05ffe4eba94 /OpenSim/Region/Framework/Scenes/Tests | |
parent | remove pointless region handle paramter from IClientAPI.SendKillObject() (diff) | |
download | opensim-SC-b4a6f2195d6d1a3a5f91715f7badf4cc983f7689.zip opensim-SC-b4a6f2195d6d1a3a5f91715f7badf4cc983f7689.tar.gz opensim-SC-b4a6f2195d6d1a3a5f91715f7badf4cc983f7689.tar.bz2 opensim-SC-b4a6f2195d6d1a3a5f91715f7badf4cc983f7689.tar.xz |
Only send one kill object to the deleter when they derez an object rather than two.
Extend regression test to check this.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index f738ff1..d670dad 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | |||
@@ -84,30 +84,31 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
84 | 84 | ||
85 | TestScene scene = new SceneHelpers().SetupScene(); | 85 | TestScene scene = new SceneHelpers().SetupScene(); |
86 | SceneHelpers.SetupSceneModules(scene, new PermissionsModule()); | 86 | SceneHelpers.SetupSceneModules(scene, new PermissionsModule()); |
87 | IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; | 87 | TestClient client = (TestClient)SceneHelpers.AddScenePresence(scene, userId).ControllingClient; |
88 | 88 | ||
89 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | 89 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. |
90 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; | 90 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; |
91 | sogd.Enabled = false; | 91 | sogd.Enabled = false; |
92 | 92 | ||
93 | SceneObjectPart part | 93 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", userId); |
94 | = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); | 94 | uint soLocalId = so.LocalId; |
95 | part.Name = "obj1"; | ||
96 | scene.AddNewSceneObject(new SceneObjectGroup(part), false); | ||
97 | 95 | ||
98 | List<uint> localIds = new List<uint>(); | 96 | List<uint> localIds = new List<uint>(); |
99 | localIds.Add(part.LocalId); | 97 | localIds.Add(so.LocalId); |
100 | scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); | 98 | scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); |
101 | 99 | ||
102 | // Check that object isn't deleted until we crank the sogd handle. | 100 | // Check that object isn't deleted until we crank the sogd handle. |
103 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | 101 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); |
104 | Assert.That(retrievedPart, Is.Not.Null); | 102 | Assert.That(retrievedPart, Is.Not.Null); |
105 | Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); | 103 | Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); |
106 | 104 | ||
107 | sogd.InventoryDeQueueAndDelete(); | 105 | sogd.InventoryDeQueueAndDelete(); |
108 | 106 | ||
109 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); | 107 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); |
110 | Assert.That(retrievedPart2, Is.Null); | 108 | Assert.That(retrievedPart2, Is.Null); |
109 | |||
110 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(1)); | ||
111 | Assert.That(client.ReceivedKills[0], Is.EqualTo(soLocalId)); | ||
111 | } | 112 | } |
112 | 113 | ||
113 | /// <summary> | 114 | /// <summary> |