aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
diff options
context:
space:
mode:
authorMelanie2012-07-25 18:19:12 +0100
committerMelanie2012-07-25 18:19:12 +0100
commit6930d696e9961c5a4ecf1c06ebc7e72ec579876d (patch)
tree325bc4ed1733cf26d6ff824e44d325d78507c0f5 /OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
parentRemove support for the OS_NPC constant. That one seems to be overly paranoid (diff)
parentRename "image queues clear" console command to "clear image queues" (diff)
downloadopensim-SC-6930d696e9961c5a4ecf1c06ebc7e72ec579876d.zip
opensim-SC-6930d696e9961c5a4ecf1c06ebc7e72ec579876d.tar.gz
opensim-SC-6930d696e9961c5a4ecf1c06ebc7e72ec579876d.tar.bz2
opensim-SC-6930d696e9961c5a4ecf1c06ebc7e72ec579876d.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
Diffstat (limited to 'OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs')
-rw-r--r--OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs22
1 files changed, 20 insertions, 2 deletions
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
80 /// <returns>The item that was added</returns> 80 /// <returns>The item that was added</returns>
81 public static TaskInventoryItem AddScript(Scene scene, SceneObjectPart part) 81 public static TaskInventoryItem AddScript(Scene scene, SceneObjectPart part)
82 { 82 {
83 return AddScript(scene, part, "scriptItem", "default { state_entry() { llSay(0, \"Hello World\"); } }");
84 }
85
86 /// <summary>
87 /// Add a simple script to the given part.
88 /// </summary>
89 /// <remarks>
90 /// TODO: Accept input for item and asset IDs to avoid mysterious script failures that try to use any of these
91 /// functions more than once in a test.
92 /// </remarks>
93 /// <param name="scene"></param>
94 /// <param name="part"></param>
95 /// <param name="scriptName">Name of the script to add</param>
96 /// <param name="scriptSource">LSL script source</param>
97 /// <returns>The item that was added</returns>
98 public static TaskInventoryItem AddScript(
99 Scene scene, SceneObjectPart part, string scriptName, string scriptSource)
100 {
83 AssetScriptText ast = new AssetScriptText(); 101 AssetScriptText ast = new AssetScriptText();
84 ast.Source = "default { state_entry() { llSay(0, \"Hello World\"); } }"; 102 ast.Source = scriptSource;
85 ast.Encode(); 103 ast.Encode();
86 104
87 UUID assetUuid = new UUID("00000000-0000-0000-1000-000000000000"); 105 UUID assetUuid = new UUID("00000000-0000-0000-1000-000000000000");
@@ -91,7 +109,7 @@ namespace OpenSim.Tests.Common
91 scene.AssetService.Store(asset); 109 scene.AssetService.Store(asset);
92 TaskInventoryItem item 110 TaskInventoryItem item
93 = new TaskInventoryItem 111 = new TaskInventoryItem
94 { Name = "scriptItem", AssetID = assetUuid, ItemID = itemUuid, 112 { Name = scriptName, AssetID = assetUuid, ItemID = itemUuid,
95 Type = (int)AssetType.LSLText, InvType = (int)InventoryType.LSL }; 113 Type = (int)AssetType.LSLText, InvType = (int)InventoryType.LSL };
96 part.Inventory.AddInventoryItem(item, true); 114 part.Inventory.AddInventoryItem(item, true);
97 115