diff options
author | Justin Clark-Casey (justincc) | 2011-08-24 21:07:46 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-24 21:07:46 +0100 |
commit | b9ec625dbf99955c983b75651430785217559483 (patch) | |
tree | e99bc07c7068ac7113e79322a074997654ca6f4d /OpenSim | |
parent | Fix llAttachToAvatar() (diff) | |
download | opensim-SC-b9ec625dbf99955c983b75651430785217559483.zip opensim-SC-b9ec625dbf99955c983b75651430785217559483.tar.gz opensim-SC-b9ec625dbf99955c983b75651430785217559483.tar.bz2 opensim-SC-b9ec625dbf99955c983b75651430785217559483.tar.xz |
add TestAddAttachmentFromGround() regression test
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | 32 |
2 files changed, 32 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index c274a5b..f254974 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -563,7 +563,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
563 | // the client/server crashes rather than logging out normally, the attachment's scripts will resume | 563 | // the client/server crashes rather than logging out normally, the attachment's scripts will resume |
564 | // without state on relog. Arguably, this is what we want anyway. | 564 | // without state on relog. Arguably, this is what we want anyway. |
565 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false); | 565 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false); |
566 | 566 | ||
567 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 567 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
568 | item = m_scene.InventoryService.GetItem(item); | 568 | item = m_scene.InventoryService.GetItem(item); |
569 | 569 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 6695a9d..b4ff055 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -81,7 +81,37 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
81 | } | 81 | } |
82 | 82 | ||
83 | [Test] | 83 | [Test] |
84 | public void TestAddAttachment() | 84 | public void TestAddAttachmentFromGround() |
85 | { | ||
86 | TestHelpers.InMethod(); | ||
87 | // log4net.Config.XmlConfigurator.Configure(); | ||
88 | |||
89 | UUID userId = TestHelpers.ParseTail(0x1); | ||
90 | string attName = "att"; | ||
91 | |||
92 | UserAccountHelpers.CreateUserWithInventory(scene, userId); | ||
93 | ScenePresence presence = SceneHelpers.AddScenePresence(scene, userId); | ||
94 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, attName).ParentGroup; | ||
95 | |||
96 | m_attMod.AttachObject(presence.ControllingClient, so, (uint)AttachmentPoint.Chest, false); | ||
97 | |||
98 | SceneObjectGroup attSo = scene.GetSceneObjectGroup(so.UUID); | ||
99 | Assert.That(attSo.IsAttachment); | ||
100 | |||
101 | // Check status on scene presence | ||
102 | Assert.That(presence.HasAttachments(), Is.True); | ||
103 | List<SceneObjectGroup> attachments = presence.Attachments; | ||
104 | Assert.That(attachments.Count, Is.EqualTo(1)); | ||
105 | Assert.That(attachments[0].Name, Is.EqualTo(attName)); | ||
106 | Assert.That(attachments[0].GetAttachmentPoint(), Is.EqualTo((byte)AttachmentPoint.Chest)); | ||
107 | |||
108 | // Check item status | ||
109 | Assert.That(presence.Appearance.GetAttachpoint( | ||
110 | attSo.GetFromItemID()), Is.EqualTo((int)AttachmentPoint.Chest)); | ||
111 | } | ||
112 | |||
113 | [Test] | ||
114 | public void TestAddAttachmentFromInventory() | ||
85 | { | 115 | { |
86 | TestHelpers.InMethod(); | 116 | TestHelpers.InMethod(); |
87 | // log4net.Config.XmlConfigurator.Configure(); | 117 | // log4net.Config.XmlConfigurator.Configure(); |