diff options
author | Justin Clark-Casey (justincc) | 2012-06-22 00:18:30 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-06-22 00:18:30 +0100 |
commit | 06617ffd06c743cebffa768bc56a979f473b5b5b (patch) | |
tree | be18ff07bb27e87efcb73c6f651a950567bf2712 /OpenSim | |
parent | Add item id, name, prim name and id to log message when state exists but load... (diff) | |
download | opensim-SC_OLD-06617ffd06c743cebffa768bc56a979f473b5b5b.zip opensim-SC_OLD-06617ffd06c743cebffa768bc56a979f473b5b5b.tar.gz opensim-SC_OLD-06617ffd06c743cebffa768bc56a979f473b5b5b.tar.bz2 opensim-SC_OLD-06617ffd06c743cebffa768bc56a979f473b5b5b.tar.xz |
Add regression test for updating attachment position
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 5e89eec..94c0030 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -303,6 +303,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
303 | Assert.That(presence.Appearance.GetAttachpoint(attItemId), Is.EqualTo((int)AttachmentPoint.Chest)); | 303 | Assert.That(presence.Appearance.GetAttachpoint(attItemId), Is.EqualTo((int)AttachmentPoint.Chest)); |
304 | } | 304 | } |
305 | 305 | ||
306 | [Test] | ||
307 | public void TestUpdateAttachmentPosition() | ||
308 | { | ||
309 | TestHelpers.InMethod(); | ||
310 | |||
311 | UUID userId = TestHelpers.ParseTail(0x1); | ||
312 | UUID attItemId = TestHelpers.ParseTail(0x2); | ||
313 | UUID attAssetId = TestHelpers.ParseTail(0x3); | ||
314 | string attName = "att"; | ||
315 | |||
316 | UserAccountHelpers.CreateUserWithInventory(scene, userId); | ||
317 | InventoryItemBase attItem | ||
318 | = UserInventoryHelpers.CreateInventoryItem( | ||
319 | scene, attName, attItemId, attAssetId, userId, InventoryType.Object); | ||
320 | |||
321 | AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId); | ||
322 | acd.Appearance = new AvatarAppearance(); | ||
323 | acd.Appearance.SetAttachment((int)AttachmentPoint.Chest, attItem.ID, attItem.AssetID); | ||
324 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, acd); | ||
325 | |||
326 | SceneObjectGroup attSo = sp.GetAttachments()[0]; | ||
327 | |||
328 | Vector3 newPosition = new Vector3(1, 2, 4); | ||
329 | |||
330 | scene.SceneGraph.UpdatePrimGroupPosition(attSo.LocalId, newPosition, sp.ControllingClient); | ||
331 | |||
332 | Assert.That(attSo.AbsolutePosition, Is.EqualTo(sp.AbsolutePosition)); | ||
333 | Assert.That(attSo.RootPart.AttachedPos, Is.EqualTo(newPosition)); | ||
334 | } | ||
335 | |||
306 | // I'm commenting this test because scene setup NEEDS InventoryService to | 336 | // I'm commenting this test because scene setup NEEDS InventoryService to |
307 | // be non-null | 337 | // be non-null |
308 | //[Test] | 338 | //[Test] |