diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs index 45e579e..c9d393f 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs | |||
@@ -58,9 +58,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
58 | m_scene = SceneSetupHelpers.SetupScene(); | 58 | m_scene = SceneSetupHelpers.SetupScene(); |
59 | SceneSetupHelpers.SetupSceneModules(m_scene, lmm, m_pcm); | 59 | SceneSetupHelpers.SetupSceneModules(m_scene, lmm, m_pcm); |
60 | 60 | ||
61 | m_lo = new LandObject(m_userId, false, m_scene); | 61 | ILandObject lo = new LandObject(m_userId, false, m_scene); |
62 | m_lo.SetLandBitmap(m_lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 62 | lo.SetLandBitmap(lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
63 | lmm.AddLandObject(m_lo); | 63 | m_lo = lmm.AddLandObject(lo); |
64 | //scene.loadAllLandObjectsFromStorage(scene.RegionInfo.originRegionID); | 64 | //scene.loadAllLandObjectsFromStorage(scene.RegionInfo.originRegionID); |
65 | } | 65 | } |
66 | 66 | ||
@@ -72,34 +72,36 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
72 | { | 72 | { |
73 | TestHelper.InMethod(); | 73 | TestHelper.InMethod(); |
74 | // log4net.Config.XmlConfigurator.Configure(); | 74 | // log4net.Config.XmlConfigurator.Configure(); |
75 | 75 | ||
76 | Assert.That(m_pcm.GetOwnerCount(m_lo.LandData.GlobalID), Is.EqualTo(0)); | 76 | IPrimCounts pc = m_lo.PrimCounts; |
77 | Assert.That(m_pcm.GetGroupCount(m_lo.LandData.GlobalID), Is.EqualTo(0)); | 77 | |
78 | Assert.That(m_pcm.GetOthersCount(m_lo.LandData.GlobalID), Is.EqualTo(0)); | 78 | Assert.That(pc.Owner, Is.EqualTo(0)); |
79 | Assert.That(m_pcm.GetUserCount(m_lo.LandData.GlobalID, m_userId), Is.EqualTo(0)); | 79 | Assert.That(pc.Group, Is.EqualTo(0)); |
80 | Assert.That(m_pcm.GetUserCount(m_lo.LandData.GlobalID, m_dummyUserId), Is.EqualTo(0)); | 80 | Assert.That(pc.Others, Is.EqualTo(0)); |
81 | Assert.That(m_pcm.GetSimulatorCount(m_lo.LandData.GlobalID), Is.EqualTo(0)); | 81 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
82 | Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); | ||
83 | Assert.That(pc.Simulator, Is.EqualTo(0)); | ||
82 | 84 | ||
83 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x01); | 85 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x01); |
84 | m_scene.AddNewSceneObject(sog, false); | 86 | m_scene.AddNewSceneObject(sog, false); |
85 | 87 | ||
86 | Assert.That(m_pcm.GetOwnerCount(m_lo.LandData.GlobalID), Is.EqualTo(3)); | 88 | Assert.That(pc.Owner, Is.EqualTo(3)); |
87 | Assert.That(m_pcm.GetGroupCount(m_lo.LandData.GlobalID), Is.EqualTo(0)); | 89 | Assert.That(pc.Group, Is.EqualTo(0)); |
88 | Assert.That(m_pcm.GetOthersCount(m_lo.LandData.GlobalID), Is.EqualTo(0)); | 90 | Assert.That(pc.Others, Is.EqualTo(0)); |
89 | Assert.That(m_pcm.GetUserCount(m_lo.LandData.GlobalID, m_userId), Is.EqualTo(3)); | 91 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); |
90 | Assert.That(m_pcm.GetUserCount(m_lo.LandData.GlobalID, m_dummyUserId), Is.EqualTo(0)); | 92 | Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); |
91 | Assert.That(m_pcm.GetSimulatorCount(m_lo.LandData.GlobalID), Is.EqualTo(3)); | 93 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
92 | 94 | ||
93 | // Add a second object and retest | 95 | // Add a second object and retest |
94 | SceneObjectGroup sog2 = SceneSetupHelpers.CreateSceneObject(2, m_userId, 0x10); | 96 | SceneObjectGroup sog2 = SceneSetupHelpers.CreateSceneObject(2, m_userId, 0x10); |
95 | m_scene.AddNewSceneObject(sog2, false); | 97 | m_scene.AddNewSceneObject(sog2, false); |
96 | 98 | ||
97 | Assert.That(m_pcm.GetOwnerCount(m_lo.LandData.GlobalID), Is.EqualTo(5)); | 99 | Assert.That(pc.Owner, Is.EqualTo(5)); |
98 | Assert.That(m_pcm.GetGroupCount(m_lo.LandData.GlobalID), Is.EqualTo(0)); | 100 | Assert.That(pc.Group, Is.EqualTo(0)); |
99 | Assert.That(m_pcm.GetOthersCount(m_lo.LandData.GlobalID), Is.EqualTo(0)); | 101 | Assert.That(pc.Others, Is.EqualTo(0)); |
100 | Assert.That(m_pcm.GetUserCount(m_lo.LandData.GlobalID, m_userId), Is.EqualTo(5)); | 102 | Assert.That(pc.Users[m_userId], Is.EqualTo(5)); |
101 | Assert.That(m_pcm.GetUserCount(m_lo.LandData.GlobalID, m_dummyUserId), Is.EqualTo(0)); | 103 | Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); |
102 | Assert.That(m_pcm.GetSimulatorCount(m_lo.LandData.GlobalID), Is.EqualTo(5)); | 104 | Assert.That(pc.Simulator, Is.EqualTo(5)); |
103 | } | 105 | } |
104 | 106 | ||
105 | /// <summary> | 107 | /// <summary> |
@@ -111,17 +113,19 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
111 | TestHelper.InMethod(); | 113 | TestHelper.InMethod(); |
112 | // log4net.Config.XmlConfigurator.Configure(); | 114 | // log4net.Config.XmlConfigurator.Configure(); |
113 | 115 | ||
116 | IPrimCounts pc = m_lo.PrimCounts; | ||
117 | |||
114 | m_scene.AddNewSceneObject(SceneSetupHelpers.CreateSceneObject(1, m_userId, 0x1), false); | 118 | m_scene.AddNewSceneObject(SceneSetupHelpers.CreateSceneObject(1, m_userId, 0x1), false); |
115 | SceneObjectGroup sogToDelete = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x10); | 119 | SceneObjectGroup sogToDelete = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x10); |
116 | m_scene.AddNewSceneObject(sogToDelete, false); | 120 | m_scene.AddNewSceneObject(sogToDelete, false); |
117 | m_scene.DeleteSceneObject(sogToDelete, false); | 121 | m_scene.DeleteSceneObject(sogToDelete, false); |
118 | 122 | ||
119 | Assert.That(m_pcm.GetOwnerCount(m_lo.LandData.GlobalID), Is.EqualTo(1)); | 123 | Assert.That(pc.Owner, Is.EqualTo(1)); |
120 | Assert.That(m_pcm.GetGroupCount(m_lo.LandData.GlobalID), Is.EqualTo(0)); | 124 | Assert.That(pc.Group, Is.EqualTo(0)); |
121 | Assert.That(m_pcm.GetOthersCount(m_lo.LandData.GlobalID), Is.EqualTo(0)); | 125 | Assert.That(pc.Others, Is.EqualTo(0)); |
122 | Assert.That(m_pcm.GetUserCount(m_lo.LandData.GlobalID, m_userId), Is.EqualTo(1)); | 126 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); |
123 | Assert.That(m_pcm.GetUserCount(m_lo.LandData.GlobalID, m_dummyUserId), Is.EqualTo(0)); | 127 | Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); |
124 | Assert.That(m_pcm.GetSimulatorCount(m_lo.LandData.GlobalID), Is.EqualTo(1)); | 128 | Assert.That(pc.Simulator, Is.EqualTo(1)); |
125 | } | 129 | } |
126 | } | 130 | } |
127 | } \ No newline at end of file | 131 | } \ No newline at end of file |