From 02105c9c2a652914a454e5f75b2197d88c36b867 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 21 Nov 2008 18:46:24 +0000 Subject: * Extend sog delete to inventory test to crank the normally async sog deleter by hand * After the crank, assert that the object has now been removed from the scene --- .../Environment/Scenes/AsyncSceneObjectGroupDeleter.cs | 6 +++++- OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs | 13 ++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Environment/Scenes/AsyncSceneObjectGroupDeleter.cs index 19ba5fa..20cf318 100644 --- a/OpenSim/Region/Environment/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Environment/Scenes/AsyncSceneObjectGroupDeleter.cs @@ -114,7 +114,11 @@ namespace OpenSim.Region.Environment.Scenes } } - private bool InventoryDeQueueAndDelete() + /// + /// Move the next object in the queue to inventory. Then delete it properly from the scene. + /// + /// + public bool InventoryDeQueueAndDelete() { DeleteToInventoryHolder x = null; diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs index 1cc95fc..a24161e 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs @@ -91,7 +91,12 @@ namespace OpenSim.Region.Environment.Scenes.Tests { UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); - TestScene scene = SceneTestUtils.SetupScene(); + TestScene scene = SceneTestUtils.SetupScene(); + + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. + AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; + sogd.Enabled = false; + SceneObjectPart part = SceneTestUtils.AddSceneObject(scene); IClientAPI client = SceneTestUtils.AddRootAgent(scene, agentId); @@ -99,6 +104,12 @@ namespace OpenSim.Region.Environment.Scenes.Tests SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); Assert.That(retrievedPart, Is.Not.Null); + + sogd.InventoryDeQueueAndDelete(); + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); + Assert.That(retrievedPart2, Is.Null); + + // TODO: test that the object actually made it successfully into inventory } } } \ No newline at end of file -- cgit v1.1