diff options
author | Justin Clark-Casey (justincc) | 2011-04-06 20:45:59 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-04-06 20:48:00 +0100 |
commit | 8318915d7ec7ed3bd25ff1027a9a8dfb695f2609 (patch) | |
tree | a2de3208364c4be20f1bd30dc168a6e88c261b5c /OpenSim/Region/CoreModules/World/Land | |
parent | Improve previous ILandObject method doc. (diff) | |
download | opensim-SC_OLD-8318915d7ec7ed3bd25ff1027a9a8dfb695f2609.zip opensim-SC_OLD-8318915d7ec7ed3bd25ff1027a9a8dfb695f2609.tar.gz opensim-SC_OLD-8318915d7ec7ed3bd25ff1027a9a8dfb695f2609.tar.bz2 opensim-SC_OLD-8318915d7ec7ed3bd25ff1027a9a8dfb695f2609.tar.xz |
Signal prim count taint if the AbsolutePosition of a scene object changes.
This updates prim counts correctly if an object is moved by something other than an avatar (e.g. scripts, region modules)
Create TestMoveOwnerObject() regression test for this case.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs index d161bb8..67b00ac 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs | |||
@@ -167,17 +167,18 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
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/ |
169 | /// </summary> | 169 | /// </summary> |
170 | //[Test] | 170 | [Test] |
171 | public void TestMoveOwnerObject() | 171 | public void TestMoveOwnerObject() |
172 | { | 172 | { |
173 | TestHelper.InMethod(); | 173 | TestHelper.InMethod(); |
174 | log4net.Config.XmlConfigurator.Configure(); | 174 | // log4net.Config.XmlConfigurator.Configure(); |
175 | 175 | ||
176 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 176 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
177 | m_scene.AddNewSceneObject(sog, false); | 177 | m_scene.AddNewSceneObject(sog, false); |
178 | SceneObjectGroup sog2 = SceneSetupHelpers.CreateSceneObject(2, m_userId, "b", 0x10); | 178 | SceneObjectGroup sog2 = SceneSetupHelpers.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 | sog.AbsolutePosition = new Vector3(254, 2, 2); | 182 | sog.AbsolutePosition = new Vector3(254, 2, 2); |
182 | 183 | ||
183 | IPrimCounts pclo1 = m_lo.PrimCounts; | 184 | IPrimCounts pclo1 = m_lo.PrimCounts; |
@@ -189,7 +190,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
189 | Assert.That(pclo1.Selected, Is.EqualTo(0)); | 190 | Assert.That(pclo1.Selected, Is.EqualTo(0)); |
190 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(2)); | 191 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(2)); |
191 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); | 192 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); |
192 | Assert.That(pclo1.Simulator, Is.EqualTo(2)); | 193 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); |
193 | 194 | ||
194 | IPrimCounts pclo2 = m_lo2.PrimCounts; | 195 | IPrimCounts pclo2 = m_lo2.PrimCounts; |
195 | 196 | ||
@@ -200,7 +201,28 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
200 | Assert.That(pclo2.Selected, Is.EqualTo(0)); | 201 | Assert.That(pclo2.Selected, Is.EqualTo(0)); |
201 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(3)); | 202 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(3)); |
202 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); | 203 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); |
203 | Assert.That(pclo2.Simulator, Is.EqualTo(3)); | 204 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); |
205 | |||
206 | // Now move it back again | ||
207 | sog.AbsolutePosition = new Vector3(2, 2, 2); | ||
208 | |||
209 | Assert.That(pclo1.Owner, Is.EqualTo(5)); | ||
210 | Assert.That(pclo1.Group, Is.EqualTo(0)); | ||
211 | Assert.That(pclo1.Others, Is.EqualTo(0)); | ||
212 | Assert.That(pclo1.Total, Is.EqualTo(5)); | ||
213 | Assert.That(pclo1.Selected, Is.EqualTo(0)); | ||
214 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(5)); | ||
215 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); | ||
216 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); | ||
217 | |||
218 | Assert.That(pclo2.Owner, Is.EqualTo(0)); | ||
219 | Assert.That(pclo2.Group, Is.EqualTo(0)); | ||
220 | Assert.That(pclo2.Others, Is.EqualTo(0)); | ||
221 | Assert.That(pclo2.Total, Is.EqualTo(0)); | ||
222 | Assert.That(pclo2.Selected, Is.EqualTo(0)); | ||
223 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(0)); | ||
224 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); | ||
225 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); | ||
204 | } | 226 | } |
205 | 227 | ||
206 | /// <summary> | 228 | /// <summary> |