aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Attachments/Tests
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-30 22:06:24 +0100
committerJustin Clark-Casey (justincc)2011-08-30 22:06:24 +0100
commite7a515bab0e46c228f8f543397f97b7ba2f0df3c (patch)
tree9c5bd0f2aea3f59b5a8b82da74b336f78f74c17e /OpenSim/Region/CoreModules/Avatar/Attachments/Tests
parentMerge branch 'master' into bulletsim (diff)
downloadopensim-SC-e7a515bab0e46c228f8f543397f97b7ba2f0df3c.zip
opensim-SC-e7a515bab0e46c228f8f543397f97b7ba2f0df3c.tar.gz
opensim-SC-e7a515bab0e46c228f8f543397f97b7ba2f0df3c.tar.bz2
opensim-SC-e7a515bab0e46c228f8f543397f97b7ba2f0df3c.tar.xz
Fix bug where attachments were remaining on the avatar after being dropped.
If the inventory service is configured not to allow deletion then these will not disappear from inventory
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments/Tests')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs14
1 files changed, 10 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
index bb53601..b1f9197 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
138 m_attMod.RezSingleAttachmentFromInventory( 138 m_attMod.RezSingleAttachmentFromInventory(
139 m_presence.ControllingClient, attItemId, (uint)AttachmentPoint.Chest); 139 m_presence.ControllingClient, attItemId, (uint)AttachmentPoint.Chest);
140 140
141 // Check status on scene presence 141 // Check scene presence status
142 Assert.That(m_presence.HasAttachments(), Is.True); 142 Assert.That(m_presence.HasAttachments(), Is.True);
143 List<SceneObjectGroup> attachments = m_presence.Attachments; 143 List<SceneObjectGroup> attachments = m_presence.Attachments;
144 Assert.That(attachments.Count, Is.EqualTo(1)); 144 Assert.That(attachments.Count, Is.EqualTo(1));
@@ -149,12 +149,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
149 Assert.That(attSo.UsesPhysics, Is.False); 149 Assert.That(attSo.UsesPhysics, Is.False);
150 Assert.That(attSo.IsTemporary, Is.False); 150 Assert.That(attSo.IsTemporary, Is.False);
151 151
152 // Check item status 152 // Check appearance status
153 Assert.That(m_presence.Appearance.GetAttachpoint(attItemId), Is.EqualTo((int)AttachmentPoint.Chest)); 153 Assert.That(m_presence.Appearance.GetAttachpoint(attItemId), Is.EqualTo((int)AttachmentPoint.Chest));
154 } 154 }
155 155
156 [Test] 156 [Test]
157 public void TestDetachAttachmentToScene() 157 public void TestDetachAttachmentToGround()
158 { 158 {
159 TestHelpers.InMethod(); 159 TestHelpers.InMethod();
160// log4net.Config.XmlConfigurator.Configure(); 160// log4net.Config.XmlConfigurator.Configure();
@@ -168,15 +168,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
168 UserInventoryHelpers.CreateInventoryItem( 168 UserInventoryHelpers.CreateInventoryItem(
169 scene, attName, attItemId, attAssetId, m_presence.UUID, InventoryType.Object); 169 scene, attName, attItemId, attAssetId, m_presence.UUID, InventoryType.Object);
170 170
171// Check item status
172 Assert.That(scene.InventoryService.GetItem(new InventoryItemBase(attItemId)), Is.Not.Null);
173
171 UUID attSoId = m_attMod.RezSingleAttachmentFromInventory( 174 UUID attSoId = m_attMod.RezSingleAttachmentFromInventory(
172 m_presence.ControllingClient, attItemId, (uint)AttachmentPoint.Chest); 175 m_presence.ControllingClient, attItemId, (uint)AttachmentPoint.Chest);
173 m_attMod.DetachSingleAttachmentToGround(attSoId, m_presence.ControllingClient); 176 m_attMod.DetachSingleAttachmentToGround(attSoId, m_presence.ControllingClient);
174 177
175 // Check status on scene presence 178 // Check scene presence status
176 Assert.That(m_presence.HasAttachments(), Is.False); 179 Assert.That(m_presence.HasAttachments(), Is.False);
177 List<SceneObjectGroup> attachments = m_presence.Attachments; 180 List<SceneObjectGroup> attachments = m_presence.Attachments;
178 Assert.That(attachments.Count, Is.EqualTo(0)); 181 Assert.That(attachments.Count, Is.EqualTo(0));
179 182
183 // Check appearance status
184 Assert.That(m_presence.Appearance.GetAttachments().Count, Is.EqualTo(0));
185
180 // Check item status 186 // Check item status
181 Assert.That(scene.InventoryService.GetItem(new InventoryItemBase(attItemId)), Is.Null); 187 Assert.That(scene.InventoryService.GetItem(new InventoryItemBase(attItemId)), Is.Null);
182 188