diff options
author | Justin Clark-Casey (justincc) | 2012-07-11 19:54:40 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-11 19:54:40 +0100 |
commit | 14d05dc2a907fcb304e622ab85150049b43f4fd5 (patch) | |
tree | b33ecd749dd2105ba899b321ff90784814ee19aa /OpenSim/Region | |
parent | If a part has a sit target and an avatar is already sitting, allow another av... (diff) | |
download | opensim-SC_OLD-14d05dc2a907fcb304e622ab85150049b43f4fd5.zip opensim-SC_OLD-14d05dc2a907fcb304e622ab85150049b43f4fd5.tar.gz opensim-SC_OLD-14d05dc2a907fcb304e622ab85150049b43f4fd5.tar.bz2 opensim-SC_OLD-14d05dc2a907fcb304e622ab85150049b43f4fd5.tar.xz |
Add regression TestRezScriptedAttachmentsFromInventory() though this currently only checks for the presence of script items, not for started scripts
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 3e06900..416aa6f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -185,7 +185,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
185 | } | 185 | } |
186 | 186 | ||
187 | [Test] | 187 | [Test] |
188 | public void TestAddAttachmentFromInventory() | 188 | public void TestRezAttachmentFromInventory() |
189 | { | 189 | { |
190 | TestHelpers.InMethod(); | 190 | TestHelpers.InMethod(); |
191 | // log4net.Config.XmlConfigurator.Configure(); | 191 | // log4net.Config.XmlConfigurator.Configure(); |
@@ -217,6 +217,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
217 | Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1)); | 217 | Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1)); |
218 | } | 218 | } |
219 | 219 | ||
220 | /// <summary> | ||
221 | /// Test specific conditions associated with rezzing a scripted attachment from inventory. | ||
222 | /// </summary> | ||
223 | [Test] | ||
224 | public void TestRezScriptedAttachmentFromInventory() | ||
225 | { | ||
226 | TestHelpers.InMethod(); | ||
227 | |||
228 | Scene scene = CreateDefaultTestScene(); | ||
229 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1); | ||
230 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1.PrincipalID); | ||
231 | |||
232 | SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID, "att-name", 0x10); | ||
233 | TaskInventoryHelpers.AddScript(scene, so.RootPart); | ||
234 | InventoryItemBase userItem = UserInventoryHelpers.AddInventoryItem(scene, so, 0x100, 0x1000); | ||
235 | |||
236 | scene.AttachmentsModule.RezSingleAttachmentFromInventory(sp, userItem.ID, (uint)AttachmentPoint.Chest); | ||
237 | |||
238 | // TODO: Need to have a test that checks the script is actually started but this involves a lot more | ||
239 | // plumbing of the script engine and either pausing for events or more infrastructure to turn off various | ||
240 | // script engine delays/asychronicity that isn't helpful in an automated regression testing context. | ||
241 | SceneObjectGroup attSo = scene.GetSceneObjectGroup(so.Name); | ||
242 | Assert.That(attSo.ContainsScripts(), Is.True); | ||
243 | } | ||
244 | |||
220 | [Test] | 245 | [Test] |
221 | public void TestDetachAttachmentToGround() | 246 | public void TestDetachAttachmentToGround() |
222 | { | 247 | { |