* 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
0.6.1-post-fixes
Justin Clarke Casey 2008-11-21 18:46:24 +00:00
parent ecac5c9c5a
commit 02105c9c2a
2 changed files with 17 additions and 2 deletions

View File

@ -114,7 +114,11 @@ namespace OpenSim.Region.Environment.Scenes
}
}
private bool InventoryDeQueueAndDelete()
/// <summary>
/// Move the next object in the queue to inventory. Then delete it properly from the scene.
/// </summary>
/// <returns></returns>
public bool InventoryDeQueueAndDelete()
{
DeleteToInventoryHolder x = null;

View File

@ -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
}
}
}