diff options
author | Justin Clark-Casey (justincc) | 2011-04-02 01:37:46 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-04-02 01:37:46 +0100 |
commit | 01b399055b06b69848ffcdeb3cafec83cbeb06d2 (patch) | |
tree | 3e16b04559238aeab270dcdb154e899a48436a26 /OpenSim/Region | |
parent | add remove others object prim count test (diff) | |
download | opensim-SC-01b399055b06b69848ffcdeb3cafec83cbeb06d2.zip opensim-SC-01b399055b06b69848ffcdeb3cafec83cbeb06d2.tar.gz opensim-SC-01b399055b06b69848ffcdeb3cafec83cbeb06d2.tar.bz2 opensim-SC-01b399055b06b69848ffcdeb3cafec83cbeb06d2.tar.xz |
add test for adding group object, factor out initial zero counts test
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs index b9eef79..38b2356 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs | |||
@@ -45,6 +45,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
45 | public class PrimCountModuleTests | 45 | public class PrimCountModuleTests |
46 | { | 46 | { |
47 | protected UUID m_userId = new UUID("00000000-0000-0000-0000-100000000000"); | 47 | protected UUID m_userId = new UUID("00000000-0000-0000-0000-100000000000"); |
48 | protected UUID m_groupId = new UUID("00000000-0000-0000-8888-000000000000"); | ||
48 | protected UUID m_otherUserId = new UUID("99999999-9999-9999-9999-999999999999"); | 49 | protected UUID m_otherUserId = new UUID("99999999-9999-9999-9999-999999999999"); |
49 | protected TestScene m_scene; | 50 | protected TestScene m_scene; |
50 | protected PrimCountModule m_pcm; | 51 | protected PrimCountModule m_pcm; |
@@ -65,14 +66,11 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
65 | } | 66 | } |
66 | 67 | ||
67 | /// <summary> | 68 | /// <summary> |
68 | /// Test count after a parcel owner owned object is added. | 69 | /// Test that counts before we do anything are correct. |
69 | /// </summary> | 70 | /// </summary> |
70 | [Test] | 71 | [Test] |
71 | public void TestAddOwnerObject() | 72 | public void TestInitialCounts() |
72 | { | 73 | { |
73 | TestHelper.InMethod(); | ||
74 | // log4net.Config.XmlConfigurator.Configure(); | ||
75 | |||
76 | IPrimCounts pc = m_lo.PrimCounts; | 74 | IPrimCounts pc = m_lo.PrimCounts; |
77 | 75 | ||
78 | Assert.That(pc.Owner, Is.EqualTo(0)); | 76 | Assert.That(pc.Owner, Is.EqualTo(0)); |
@@ -82,7 +80,19 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
82 | Assert.That(pc.Selected, Is.EqualTo(0)); | 80 | Assert.That(pc.Selected, Is.EqualTo(0)); |
83 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 81 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
84 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 82 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
85 | Assert.That(pc.Simulator, Is.EqualTo(0)); | 83 | Assert.That(pc.Simulator, Is.EqualTo(0)); |
84 | } | ||
85 | |||
86 | /// <summary> | ||
87 | /// Test count after a parcel owner owned object is added. | ||
88 | /// </summary> | ||
89 | [Test] | ||
90 | public void TestAddOwnerObject() | ||
91 | { | ||
92 | TestHelper.InMethod(); | ||
93 | // log4net.Config.XmlConfigurator.Configure(); | ||
94 | |||
95 | IPrimCounts pc = m_lo.PrimCounts; | ||
86 | 96 | ||
87 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x01); | 97 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x01); |
88 | m_scene.AddNewSceneObject(sog, false); | 98 | m_scene.AddNewSceneObject(sog, false); |
@@ -159,7 +169,35 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
159 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); | 169 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); |
160 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 170 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
161 | Assert.That(pc.Simulator, Is.EqualTo(1)); | 171 | Assert.That(pc.Simulator, Is.EqualTo(1)); |
162 | } | 172 | } |
173 | |||
174 | [Test] | ||
175 | public void TestAddGroupObject() | ||
176 | { | ||
177 | TestHelper.InMethod(); | ||
178 | // log4net.Config.XmlConfigurator.Configure(); | ||
179 | |||
180 | m_lo.DeedToGroup(m_groupId); | ||
181 | |||
182 | IPrimCounts pc = m_lo.PrimCounts; | ||
183 | |||
184 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_otherUserId, 0x01); | ||
185 | sog.GroupID = m_groupId; | ||
186 | m_scene.AddNewSceneObject(sog, false); | ||
187 | |||
188 | Assert.That(pc.Owner, Is.EqualTo(0)); | ||
189 | Assert.That(pc.Group, Is.EqualTo(3)); | ||
190 | Assert.That(pc.Others, Is.EqualTo(0)); | ||
191 | Assert.That(pc.Total, Is.EqualTo(3)); | ||
192 | Assert.That(pc.Selected, Is.EqualTo(0)); | ||
193 | |||
194 | // Is this desired behaviour? Not totally sure. | ||
195 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | ||
196 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); | ||
197 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); | ||
198 | |||
199 | Assert.That(pc.Simulator, Is.EqualTo(3)); | ||
200 | } | ||
163 | 201 | ||
164 | [Test] | 202 | [Test] |
165 | public void TestAddOthersObject() | 203 | public void TestAddOthersObject() |