From ebbe3afaf15fa07f4a8d1c2db8795065b852ec8d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 23 Mar 2011 23:14:55 +0000
Subject: Add PrimCountModuleTests.TestRemoveOwnerObject().
Also adds SceneSetupHelpers methods to easily create sogs with different part UUIDs
---
.../World/Land/Tests/PrimCountModuleTests.cs | 39 +++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
index 72f74fa..e6b8627 100644
--- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
+++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
@@ -44,8 +44,11 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
[TestFixture]
public class PrimCountModuleTests
{
+ ///
+ /// Test count after a parcel owner owned object is added.
+ ///
[Test]
- public void TestAddObject()
+ public void TestAddOwnerObject()
{
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
@@ -80,5 +83,39 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
Assert.That(pcm.GetUserCount(lo.LandData.GlobalID, dummyUserId), Is.EqualTo(0));
Assert.That(pcm.GetSimulatorCount(lo.LandData.GlobalID), Is.EqualTo(3));
}
+
+ ///
+ /// Test count after a parcel owner owned object is removed.
+ ///
+ [Test]
+ public void TestRemoveOwnerObject()
+ {
+ TestHelper.InMethod();
+// log4net.Config.XmlConfigurator.Configure();
+
+ PrimCountModule pcm = new PrimCountModule();
+ LandManagementModule lmm = new LandManagementModule();
+ Scene scene = SceneSetupHelpers.SetupScene();
+ SceneSetupHelpers.SetupSceneModules(scene, lmm, pcm);
+
+ UUID userId = new UUID("00000000-0000-0000-0000-000000000010");
+ UUID dummyUserId = new UUID("99999999-9999-9999-9999-999999999999");
+ ILandObject lo = new LandObject(userId, false, scene);
+ lo.SetLandBitmap(lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize));
+ lmm.AddLandObject(lo);
+ //scene.loadAllLandObjectsFromStorage(scene.RegionInfo.originRegionID);
+
+ scene.AddNewSceneObject(SceneSetupHelpers.CreateSceneObject(1, userId, 0x1), false);
+ SceneObjectGroup sogToDelete = SceneSetupHelpers.CreateSceneObject(3, userId, 0x10);
+ scene.AddNewSceneObject(sogToDelete, false);
+ scene.DeleteSceneObject(sogToDelete, false);
+
+ Assert.That(pcm.GetOwnerCount(lo.LandData.GlobalID), Is.EqualTo(1));
+ Assert.That(pcm.GetGroupCount(lo.LandData.GlobalID), Is.EqualTo(0));
+ Assert.That(pcm.GetOthersCount(lo.LandData.GlobalID), Is.EqualTo(0));
+ Assert.That(pcm.GetUserCount(lo.LandData.GlobalID, userId), Is.EqualTo(1));
+ Assert.That(pcm.GetUserCount(lo.LandData.GlobalID, dummyUserId), Is.EqualTo(0));
+ Assert.That(pcm.GetSimulatorCount(lo.LandData.GlobalID), Is.EqualTo(1));
+ }
}
}
\ No newline at end of file
--
cgit v1.1