diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs | 224 |
1 files changed, 112 insertions, 112 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs index 949acb6..a349aa1 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs | |||
@@ -43,21 +43,21 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
43 | public class PrimCountModuleTests : OpenSimTestCase | 43 | public class PrimCountModuleTests : OpenSimTestCase |
44 | { | 44 | { |
45 | protected UUID m_userId = new UUID("00000000-0000-0000-0000-100000000000"); | 45 | protected UUID m_userId = new UUID("00000000-0000-0000-0000-100000000000"); |
46 | protected UUID m_groupId = new UUID("00000000-0000-0000-8888-000000000000"); | 46 | protected UUID m_groupId = new UUID("00000000-0000-0000-8888-000000000000"); |
47 | protected UUID m_otherUserId = new UUID("99999999-9999-9999-9999-999999999999"); | 47 | protected UUID m_otherUserId = new UUID("99999999-9999-9999-9999-999999999999"); |
48 | protected TestScene m_scene; | 48 | protected TestScene m_scene; |
49 | protected PrimCountModule m_pcm; | 49 | protected PrimCountModule m_pcm; |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// A parcel that covers the entire sim except for a 1 unit wide strip on the eastern side. | 52 | /// A parcel that covers the entire sim except for a 1 unit wide strip on the eastern side. |
53 | /// </summary> | 53 | /// </summary> |
54 | protected ILandObject m_lo; | 54 | protected ILandObject m_lo; |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// A parcel that covers just the eastern strip of the sim. | 57 | /// A parcel that covers just the eastern strip of the sim. |
58 | /// </summary> | 58 | /// </summary> |
59 | protected ILandObject m_lo2; | 59 | protected ILandObject m_lo2; |
60 | 60 | ||
61 | [SetUp] | 61 | [SetUp] |
62 | public override void SetUp() | 62 | public override void SetUp() |
63 | { | 63 | { |
@@ -65,24 +65,24 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
65 | 65 | ||
66 | m_pcm = new PrimCountModule(); | 66 | m_pcm = new PrimCountModule(); |
67 | LandManagementModule lmm = new LandManagementModule(); | 67 | LandManagementModule lmm = new LandManagementModule(); |
68 | m_scene = new SceneHelpers().SetupScene(); | 68 | m_scene = new SceneHelpers().SetupScene(); |
69 | SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm); | 69 | SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm); |
70 | 70 | ||
71 | int xParcelDivider = (int)Constants.RegionSize - 1; | 71 | int xParcelDivider = (int)Constants.RegionSize - 1; |
72 | 72 | ||
73 | ILandObject lo = new LandObject(m_userId, false, m_scene); | 73 | ILandObject lo = new LandObject(m_userId, false, m_scene); |
74 | lo.LandData.Name = "m_lo"; | 74 | lo.LandData.Name = "m_lo"; |
75 | lo.SetLandBitmap( | 75 | lo.SetLandBitmap( |
76 | lo.GetSquareLandBitmap(0, 0, xParcelDivider, (int)Constants.RegionSize)); | 76 | lo.GetSquareLandBitmap(0, 0, xParcelDivider, (int)Constants.RegionSize)); |
77 | m_lo = lmm.AddLandObject(lo); | 77 | m_lo = lmm.AddLandObject(lo); |
78 | 78 | ||
79 | ILandObject lo2 = new LandObject(m_userId, false, m_scene); | 79 | ILandObject lo2 = new LandObject(m_userId, false, m_scene); |
80 | lo2.SetLandBitmap( | 80 | lo2.SetLandBitmap( |
81 | lo2.GetSquareLandBitmap(xParcelDivider, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 81 | lo2.GetSquareLandBitmap(xParcelDivider, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
82 | lo2.LandData.Name = "m_lo2"; | 82 | lo2.LandData.Name = "m_lo2"; |
83 | m_lo2 = lmm.AddLandObject(lo2); | 83 | m_lo2 = lmm.AddLandObject(lo2); |
84 | } | 84 | } |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// Test that counts before we do anything are correct. | 87 | /// Test that counts before we do anything are correct. |
88 | /// </summary> | 88 | /// </summary> |
@@ -90,7 +90,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
90 | public void TestInitialCounts() | 90 | public void TestInitialCounts() |
91 | { | 91 | { |
92 | IPrimCounts pc = m_lo.PrimCounts; | 92 | IPrimCounts pc = m_lo.PrimCounts; |
93 | 93 | ||
94 | Assert.That(pc.Owner, Is.EqualTo(0)); | 94 | Assert.That(pc.Owner, Is.EqualTo(0)); |
95 | Assert.That(pc.Group, Is.EqualTo(0)); | 95 | Assert.That(pc.Group, Is.EqualTo(0)); |
96 | Assert.That(pc.Others, Is.EqualTo(0)); | 96 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -98,9 +98,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
98 | Assert.That(pc.Selected, Is.EqualTo(0)); | 98 | Assert.That(pc.Selected, Is.EqualTo(0)); |
99 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 99 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
100 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 100 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
101 | Assert.That(pc.Simulator, Is.EqualTo(0)); | 101 | Assert.That(pc.Simulator, Is.EqualTo(0)); |
102 | } | 102 | } |
103 | 103 | ||
104 | /// <summary> | 104 | /// <summary> |
105 | /// Test count after a parcel owner owned object is added. | 105 | /// Test count after a parcel owner owned object is added. |
106 | /// </summary> | 106 | /// </summary> |
@@ -108,13 +108,13 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
108 | public void TestAddOwnerObject() | 108 | public void TestAddOwnerObject() |
109 | { | 109 | { |
110 | TestHelpers.InMethod(); | 110 | TestHelpers.InMethod(); |
111 | // log4net.Config.XmlConfigurator.Configure(); | 111 | // log4net.Config.XmlConfigurator.Configure(); |
112 | 112 | ||
113 | IPrimCounts pc = m_lo.PrimCounts; | 113 | IPrimCounts pc = m_lo.PrimCounts; |
114 | 114 | ||
115 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 115 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
116 | m_scene.AddNewSceneObject(sog, false); | 116 | m_scene.AddNewSceneObject(sog, false); |
117 | 117 | ||
118 | Assert.That(pc.Owner, Is.EqualTo(3)); | 118 | Assert.That(pc.Owner, Is.EqualTo(3)); |
119 | Assert.That(pc.Group, Is.EqualTo(0)); | 119 | Assert.That(pc.Group, Is.EqualTo(0)); |
120 | Assert.That(pc.Others, Is.EqualTo(0)); | 120 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -122,12 +122,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
122 | Assert.That(pc.Selected, Is.EqualTo(0)); | 122 | Assert.That(pc.Selected, Is.EqualTo(0)); |
123 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); | 123 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); |
124 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 124 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
125 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 125 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
126 | 126 | ||
127 | // Add a second object and retest | 127 | // Add a second object and retest |
128 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); | 128 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); |
129 | m_scene.AddNewSceneObject(sog2, false); | 129 | m_scene.AddNewSceneObject(sog2, false); |
130 | 130 | ||
131 | Assert.That(pc.Owner, Is.EqualTo(5)); | 131 | Assert.That(pc.Owner, Is.EqualTo(5)); |
132 | Assert.That(pc.Group, Is.EqualTo(0)); | 132 | Assert.That(pc.Group, Is.EqualTo(0)); |
133 | Assert.That(pc.Others, Is.EqualTo(0)); | 133 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -135,9 +135,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
135 | Assert.That(pc.Selected, Is.EqualTo(0)); | 135 | Assert.That(pc.Selected, Is.EqualTo(0)); |
136 | Assert.That(pc.Users[m_userId], Is.EqualTo(5)); | 136 | Assert.That(pc.Users[m_userId], Is.EqualTo(5)); |
137 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 137 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
138 | Assert.That(pc.Simulator, Is.EqualTo(5)); | 138 | Assert.That(pc.Simulator, Is.EqualTo(5)); |
139 | } | 139 | } |
140 | 140 | ||
141 | /// <summary> | 141 | /// <summary> |
142 | /// Test count after a parcel owner owned copied object is added. | 142 | /// Test count after a parcel owner owned copied object is added. |
143 | /// </summary> | 143 | /// </summary> |
@@ -145,14 +145,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
145 | public void TestCopyOwnerObject() | 145 | public void TestCopyOwnerObject() |
146 | { | 146 | { |
147 | TestHelpers.InMethod(); | 147 | TestHelpers.InMethod(); |
148 | // log4net.Config.XmlConfigurator.Configure(); | 148 | // log4net.Config.XmlConfigurator.Configure(); |
149 | 149 | ||
150 | IPrimCounts pc = m_lo.PrimCounts; | 150 | IPrimCounts pc = m_lo.PrimCounts; |
151 | 151 | ||
152 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 152 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
153 | m_scene.AddNewSceneObject(sog, false); | 153 | m_scene.AddNewSceneObject(sog, false); |
154 | m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity); | 154 | m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, m_userId, UUID.Zero, Quaternion.Identity, false); |
155 | 155 | ||
156 | Assert.That(pc.Owner, Is.EqualTo(6)); | 156 | Assert.That(pc.Owner, Is.EqualTo(6)); |
157 | Assert.That(pc.Group, Is.EqualTo(0)); | 157 | Assert.That(pc.Group, Is.EqualTo(0)); |
158 | Assert.That(pc.Others, Is.EqualTo(0)); | 158 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -160,9 +160,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
160 | Assert.That(pc.Selected, Is.EqualTo(0)); | 160 | Assert.That(pc.Selected, Is.EqualTo(0)); |
161 | Assert.That(pc.Users[m_userId], Is.EqualTo(6)); | 161 | Assert.That(pc.Users[m_userId], Is.EqualTo(6)); |
162 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 162 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
163 | Assert.That(pc.Simulator, Is.EqualTo(6)); | 163 | Assert.That(pc.Simulator, Is.EqualTo(6)); |
164 | } | 164 | } |
165 | 165 | ||
166 | /// <summary> | 166 | /// <summary> |
167 | /// Test that parcel counts update correctly when an object is moved between parcels, where that movement | 167 | /// Test that parcel counts update correctly when an object is moved between parcels, where that movement |
168 | /// is not done directly by the user/ | 168 | /// is not done directly by the user/ |
@@ -171,18 +171,18 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
171 | public void TestMoveOwnerObject() | 171 | public void TestMoveOwnerObject() |
172 | { | 172 | { |
173 | TestHelpers.InMethod(); | 173 | TestHelpers.InMethod(); |
174 | // log4net.Config.XmlConfigurator.Configure(); | 174 | // log4net.Config.XmlConfigurator.Configure(); |
175 | 175 | ||
176 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 176 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
177 | m_scene.AddNewSceneObject(sog, false); | 177 | m_scene.AddNewSceneObject(sog, false); |
178 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); | 178 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); |
179 | m_scene.AddNewSceneObject(sog2, false); | 179 | m_scene.AddNewSceneObject(sog2, false); |
180 | 180 | ||
181 | // Move the first scene object to the eastern strip parcel | 181 | // Move the first scene object to the eastern strip parcel |
182 | sog.AbsolutePosition = new Vector3(254, 2, 2); | 182 | sog.AbsolutePosition = new Vector3(254, 2, 2); |
183 | 183 | ||
184 | IPrimCounts pclo1 = m_lo.PrimCounts; | 184 | IPrimCounts pclo1 = m_lo.PrimCounts; |
185 | 185 | ||
186 | Assert.That(pclo1.Owner, Is.EqualTo(2)); | 186 | Assert.That(pclo1.Owner, Is.EqualTo(2)); |
187 | Assert.That(pclo1.Group, Is.EqualTo(0)); | 187 | Assert.That(pclo1.Group, Is.EqualTo(0)); |
188 | Assert.That(pclo1.Others, Is.EqualTo(0)); | 188 | Assert.That(pclo1.Others, Is.EqualTo(0)); |
@@ -190,10 +190,10 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
190 | Assert.That(pclo1.Selected, Is.EqualTo(0)); | 190 | Assert.That(pclo1.Selected, Is.EqualTo(0)); |
191 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(2)); | 191 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(2)); |
192 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); | 192 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); |
193 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); | 193 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); |
194 | 194 | ||
195 | IPrimCounts pclo2 = m_lo2.PrimCounts; | 195 | IPrimCounts pclo2 = m_lo2.PrimCounts; |
196 | 196 | ||
197 | Assert.That(pclo2.Owner, Is.EqualTo(3)); | 197 | Assert.That(pclo2.Owner, Is.EqualTo(3)); |
198 | Assert.That(pclo2.Group, Is.EqualTo(0)); | 198 | Assert.That(pclo2.Group, Is.EqualTo(0)); |
199 | Assert.That(pclo2.Others, Is.EqualTo(0)); | 199 | Assert.That(pclo2.Others, Is.EqualTo(0)); |
@@ -201,11 +201,11 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
201 | Assert.That(pclo2.Selected, Is.EqualTo(0)); | 201 | Assert.That(pclo2.Selected, Is.EqualTo(0)); |
202 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(3)); | 202 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(3)); |
203 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); | 203 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); |
204 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); | 204 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); |
205 | 205 | ||
206 | // Now move it back again | 206 | // Now move it back again |
207 | sog.AbsolutePosition = new Vector3(2, 2, 2); | 207 | sog.AbsolutePosition = new Vector3(2, 2, 2); |
208 | 208 | ||
209 | Assert.That(pclo1.Owner, Is.EqualTo(5)); | 209 | Assert.That(pclo1.Owner, Is.EqualTo(5)); |
210 | Assert.That(pclo1.Group, Is.EqualTo(0)); | 210 | Assert.That(pclo1.Group, Is.EqualTo(0)); |
211 | Assert.That(pclo1.Others, Is.EqualTo(0)); | 211 | Assert.That(pclo1.Others, Is.EqualTo(0)); |
@@ -213,8 +213,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
213 | Assert.That(pclo1.Selected, Is.EqualTo(0)); | 213 | Assert.That(pclo1.Selected, Is.EqualTo(0)); |
214 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(5)); | 214 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(5)); |
215 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); | 215 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); |
216 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); | 216 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); |
217 | 217 | ||
218 | Assert.That(pclo2.Owner, Is.EqualTo(0)); | 218 | Assert.That(pclo2.Owner, Is.EqualTo(0)); |
219 | Assert.That(pclo2.Group, Is.EqualTo(0)); | 219 | Assert.That(pclo2.Group, Is.EqualTo(0)); |
220 | Assert.That(pclo2.Others, Is.EqualTo(0)); | 220 | Assert.That(pclo2.Others, Is.EqualTo(0)); |
@@ -222,9 +222,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
222 | Assert.That(pclo2.Selected, Is.EqualTo(0)); | 222 | Assert.That(pclo2.Selected, Is.EqualTo(0)); |
223 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(0)); | 223 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(0)); |
224 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); | 224 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); |
225 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); | 225 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); |
226 | } | 226 | } |
227 | 227 | ||
228 | /// <summary> | 228 | /// <summary> |
229 | /// Test count after a parcel owner owned object is removed. | 229 | /// Test count after a parcel owner owned object is removed. |
230 | /// </summary> | 230 | /// </summary> |
@@ -233,14 +233,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
233 | { | 233 | { |
234 | TestHelpers.InMethod(); | 234 | TestHelpers.InMethod(); |
235 | // log4net.Config.XmlConfigurator.Configure(); | 235 | // log4net.Config.XmlConfigurator.Configure(); |
236 | 236 | ||
237 | IPrimCounts pc = m_lo.PrimCounts; | 237 | IPrimCounts pc = m_lo.PrimCounts; |
238 | 238 | ||
239 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1), false); | 239 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1), false); |
240 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); | 240 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); |
241 | m_scene.AddNewSceneObject(sogToDelete, false); | 241 | m_scene.AddNewSceneObject(sogToDelete, false); |
242 | m_scene.DeleteSceneObject(sogToDelete, false); | 242 | m_scene.DeleteSceneObject(sogToDelete, false); |
243 | 243 | ||
244 | Assert.That(pc.Owner, Is.EqualTo(1)); | 244 | Assert.That(pc.Owner, Is.EqualTo(1)); |
245 | Assert.That(pc.Group, Is.EqualTo(0)); | 245 | Assert.That(pc.Group, Is.EqualTo(0)); |
246 | Assert.That(pc.Others, Is.EqualTo(0)); | 246 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -248,37 +248,37 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
248 | Assert.That(pc.Selected, Is.EqualTo(0)); | 248 | Assert.That(pc.Selected, Is.EqualTo(0)); |
249 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); | 249 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); |
250 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 250 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
251 | Assert.That(pc.Simulator, Is.EqualTo(1)); | 251 | Assert.That(pc.Simulator, Is.EqualTo(1)); |
252 | } | 252 | } |
253 | 253 | ||
254 | [Test] | 254 | [Test] |
255 | public void TestAddGroupObject() | 255 | public void TestAddGroupObject() |
256 | { | 256 | { |
257 | TestHelpers.InMethod(); | 257 | TestHelpers.InMethod(); |
258 | // log4net.Config.XmlConfigurator.Configure(); | 258 | // log4net.Config.XmlConfigurator.Configure(); |
259 | 259 | ||
260 | m_lo.DeedToGroup(m_groupId); | 260 | m_lo.DeedToGroup(m_groupId); |
261 | 261 | ||
262 | IPrimCounts pc = m_lo.PrimCounts; | 262 | IPrimCounts pc = m_lo.PrimCounts; |
263 | 263 | ||
264 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); | 264 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); |
265 | sog.GroupID = m_groupId; | 265 | sog.GroupID = m_groupId; |
266 | m_scene.AddNewSceneObject(sog, false); | 266 | m_scene.AddNewSceneObject(sog, false); |
267 | 267 | ||
268 | Assert.That(pc.Owner, Is.EqualTo(0)); | 268 | Assert.That(pc.Owner, Is.EqualTo(0)); |
269 | Assert.That(pc.Group, Is.EqualTo(3)); | 269 | Assert.That(pc.Group, Is.EqualTo(3)); |
270 | Assert.That(pc.Others, Is.EqualTo(0)); | 270 | Assert.That(pc.Others, Is.EqualTo(0)); |
271 | Assert.That(pc.Total, Is.EqualTo(3)); | 271 | Assert.That(pc.Total, Is.EqualTo(3)); |
272 | Assert.That(pc.Selected, Is.EqualTo(0)); | 272 | Assert.That(pc.Selected, Is.EqualTo(0)); |
273 | 273 | ||
274 | // Is this desired behaviour? Not totally sure. | 274 | // Is this desired behaviour? Not totally sure. |
275 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 275 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
276 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); | 276 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); |
277 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); | 277 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); |
278 | 278 | ||
279 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 279 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
280 | } | 280 | } |
281 | 281 | ||
282 | /// <summary> | 282 | /// <summary> |
283 | /// Test count after a parcel owner owned object is removed. | 283 | /// Test count after a parcel owner owned object is removed. |
284 | /// </summary> | 284 | /// </summary> |
@@ -287,19 +287,19 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
287 | { | 287 | { |
288 | TestHelpers.InMethod(); | 288 | TestHelpers.InMethod(); |
289 | // log4net.Config.XmlConfigurator.Configure(); | 289 | // log4net.Config.XmlConfigurator.Configure(); |
290 | 290 | ||
291 | m_lo.DeedToGroup(m_groupId); | 291 | m_lo.DeedToGroup(m_groupId); |
292 | 292 | ||
293 | IPrimCounts pc = m_lo.PrimCounts; | 293 | IPrimCounts pc = m_lo.PrimCounts; |
294 | 294 | ||
295 | SceneObjectGroup sogToKeep = SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1); | 295 | SceneObjectGroup sogToKeep = SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1); |
296 | sogToKeep.GroupID = m_groupId; | 296 | sogToKeep.GroupID = m_groupId; |
297 | m_scene.AddNewSceneObject(sogToKeep, false); | 297 | m_scene.AddNewSceneObject(sogToKeep, false); |
298 | 298 | ||
299 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); | 299 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); |
300 | m_scene.AddNewSceneObject(sogToDelete, false); | 300 | m_scene.AddNewSceneObject(sogToDelete, false); |
301 | m_scene.DeleteSceneObject(sogToDelete, false); | 301 | m_scene.DeleteSceneObject(sogToDelete, false); |
302 | 302 | ||
303 | Assert.That(pc.Owner, Is.EqualTo(0)); | 303 | Assert.That(pc.Owner, Is.EqualTo(0)); |
304 | Assert.That(pc.Group, Is.EqualTo(1)); | 304 | Assert.That(pc.Group, Is.EqualTo(1)); |
305 | Assert.That(pc.Others, Is.EqualTo(0)); | 305 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -308,20 +308,20 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
308 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); | 308 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); |
309 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); | 309 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); |
310 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 310 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
311 | Assert.That(pc.Simulator, Is.EqualTo(1)); | 311 | Assert.That(pc.Simulator, Is.EqualTo(1)); |
312 | } | 312 | } |
313 | 313 | ||
314 | [Test] | 314 | [Test] |
315 | public void TestAddOthersObject() | 315 | public void TestAddOthersObject() |
316 | { | 316 | { |
317 | TestHelpers.InMethod(); | 317 | TestHelpers.InMethod(); |
318 | // log4net.Config.XmlConfigurator.Configure(); | 318 | // log4net.Config.XmlConfigurator.Configure(); |
319 | 319 | ||
320 | IPrimCounts pc = m_lo.PrimCounts; | 320 | IPrimCounts pc = m_lo.PrimCounts; |
321 | 321 | ||
322 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); | 322 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); |
323 | m_scene.AddNewSceneObject(sog, false); | 323 | m_scene.AddNewSceneObject(sog, false); |
324 | 324 | ||
325 | Assert.That(pc.Owner, Is.EqualTo(0)); | 325 | Assert.That(pc.Owner, Is.EqualTo(0)); |
326 | Assert.That(pc.Group, Is.EqualTo(0)); | 326 | Assert.That(pc.Group, Is.EqualTo(0)); |
327 | Assert.That(pc.Others, Is.EqualTo(3)); | 327 | Assert.That(pc.Others, Is.EqualTo(3)); |
@@ -329,22 +329,22 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
329 | Assert.That(pc.Selected, Is.EqualTo(0)); | 329 | Assert.That(pc.Selected, Is.EqualTo(0)); |
330 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 330 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
331 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); | 331 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); |
332 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 332 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
333 | } | 333 | } |
334 | 334 | ||
335 | [Test] | 335 | [Test] |
336 | public void TestRemoveOthersObject() | 336 | public void TestRemoveOthersObject() |
337 | { | 337 | { |
338 | TestHelpers.InMethod(); | 338 | TestHelpers.InMethod(); |
339 | // log4net.Config.XmlConfigurator.Configure(); | 339 | // log4net.Config.XmlConfigurator.Configure(); |
340 | 340 | ||
341 | IPrimCounts pc = m_lo.PrimCounts; | 341 | IPrimCounts pc = m_lo.PrimCounts; |
342 | 342 | ||
343 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_otherUserId, "a", 0x1), false); | 343 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_otherUserId, "a", 0x1), false); |
344 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_otherUserId, "b", 0x10); | 344 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_otherUserId, "b", 0x10); |
345 | m_scene.AddNewSceneObject(sogToDelete, false); | 345 | m_scene.AddNewSceneObject(sogToDelete, false); |
346 | m_scene.DeleteSceneObject(sogToDelete, false); | 346 | m_scene.DeleteSceneObject(sogToDelete, false); |
347 | 347 | ||
348 | Assert.That(pc.Owner, Is.EqualTo(0)); | 348 | Assert.That(pc.Owner, Is.EqualTo(0)); |
349 | Assert.That(pc.Group, Is.EqualTo(0)); | 349 | Assert.That(pc.Group, Is.EqualTo(0)); |
350 | Assert.That(pc.Others, Is.EqualTo(1)); | 350 | Assert.That(pc.Others, Is.EqualTo(1)); |
@@ -352,9 +352,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
352 | Assert.That(pc.Selected, Is.EqualTo(0)); | 352 | Assert.That(pc.Selected, Is.EqualTo(0)); |
353 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 353 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
354 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(1)); | 354 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(1)); |
355 | Assert.That(pc.Simulator, Is.EqualTo(1)); | 355 | Assert.That(pc.Simulator, Is.EqualTo(1)); |
356 | } | 356 | } |
357 | 357 | ||
358 | /// <summary> | 358 | /// <summary> |
359 | /// Test the count is correct after is has been tainted. | 359 | /// Test the count is correct after is has been tainted. |
360 | /// </summary> | 360 | /// </summary> |
@@ -363,12 +363,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
363 | { | 363 | { |
364 | TestHelpers.InMethod(); | 364 | TestHelpers.InMethod(); |
365 | IPrimCounts pc = m_lo.PrimCounts; | 365 | IPrimCounts pc = m_lo.PrimCounts; |
366 | 366 | ||
367 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 367 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
368 | m_scene.AddNewSceneObject(sog, false); | 368 | m_scene.AddNewSceneObject(sog, false); |
369 | 369 | ||
370 | m_pcm.TaintPrimCount(); | 370 | m_pcm.TaintPrimCount(); |
371 | 371 | ||
372 | Assert.That(pc.Owner, Is.EqualTo(3)); | 372 | Assert.That(pc.Owner, Is.EqualTo(3)); |
373 | Assert.That(pc.Group, Is.EqualTo(0)); | 373 | Assert.That(pc.Group, Is.EqualTo(0)); |
374 | Assert.That(pc.Others, Is.EqualTo(0)); | 374 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -376,7 +376,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
376 | Assert.That(pc.Selected, Is.EqualTo(0)); | 376 | Assert.That(pc.Selected, Is.EqualTo(0)); |
377 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); | 377 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); |
378 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 378 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
379 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 379 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
380 | } | 380 | } |
381 | } | 381 | } |
382 | } \ No newline at end of file | 382 | } \ No newline at end of file |