From 2858b1b1f44f67d7ac88b5dcaffbc9710e9e365c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 24 Jul 2012 22:33:54 +0100
Subject: extend regression TestDetachScriptedAttachementToInventory() to check
correct running status on a re-rezzed attachment
---
.../Tests/Common/Helpers/TaskInventoryHelpers.cs | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Tests/Common')
diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
index fba03ab..0a2b30a 100644
--- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
@@ -80,8 +80,26 @@ namespace OpenSim.Tests.Common
/// The item that was added
public static TaskInventoryItem AddScript(Scene scene, SceneObjectPart part)
{
+ return AddScript(scene, part, "scriptItem", "default { state_entry() { llSay(0, \"Hello World\"); } }");
+ }
+
+ ///
+ /// Add a simple script to the given part.
+ ///
+ ///
+ /// TODO: Accept input for item and asset IDs to avoid mysterious script failures that try to use any of these
+ /// functions more than once in a test.
+ ///
+ ///
+ ///
+ /// Name of the script to add
+ /// LSL script source
+ /// The item that was added
+ public static TaskInventoryItem AddScript(
+ Scene scene, SceneObjectPart part, string scriptName, string scriptSource)
+ {
AssetScriptText ast = new AssetScriptText();
- ast.Source = "default { state_entry() { llSay(0, \"Hello World\"); } }";
+ ast.Source = scriptSource;
ast.Encode();
UUID assetUuid = new UUID("00000000-0000-0000-1000-000000000000");
@@ -91,7 +109,7 @@ namespace OpenSim.Tests.Common
scene.AssetService.Store(asset);
TaskInventoryItem item
= new TaskInventoryItem
- { Name = "scriptItem", AssetID = assetUuid, ItemID = itemUuid,
+ { Name = scriptName, AssetID = assetUuid, ItemID = itemUuid,
Type = (int)AssetType.LSLText, InvType = (int)InventoryType.LSL };
part.Inventory.AddInventoryItem(item, true);
--
cgit v1.1