From 14684116f8ef23892b71ef16759224a536ac27bf Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 28 Feb 2013 20:57:03 +0000
Subject: Add regression tests for llGetNotecardLine()
---
.../Tests/Common/Helpers/TaskInventoryHelpers.cs | 32 ++++++++++++++++++----
1 file changed, 26 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs')
diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
index 0a2b30a..bb4b55f 100644
--- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
@@ -46,13 +46,32 @@ namespace OpenSim.Tests.Common
///
///
///
+ /// UUID or UUID stem
+ /// UUID or UUID stem
+ /// The tex to put in the notecard.
+ /// The item that was added
+ public static TaskInventoryItem AddNotecard(
+ Scene scene, SceneObjectPart part, string itemName, string itemIDStem, string assetIDStem, string text)
+ {
+ return AddNotecard(
+ scene, part, itemName, TestHelpers.ParseStem(itemIDStem), TestHelpers.ParseStem(assetIDStem), text);
+ }
+
+ ///
+ /// Add a notecard item to the given part.
+ ///
+ ///
+ ///
+ ///
///
///
+ /// The tex to put in the notecard.
/// The item that was added
- public static TaskInventoryItem AddNotecard(Scene scene, SceneObjectPart part, string itemName, UUID itemID, UUID assetID)
+ public static TaskInventoryItem AddNotecard(
+ Scene scene, SceneObjectPart part, string itemName, UUID itemID, UUID assetID, string text)
{
AssetNotecard nc = new AssetNotecard();
- nc.BodyText = "Hello World!";
+ nc.BodyText = text;
nc.Encode();
AssetBase ncAsset
@@ -87,8 +106,8 @@ namespace OpenSim.Tests.Common
/// 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.
+ /// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather
+ /// than a random component.
///
///
///
@@ -102,8 +121,9 @@ namespace OpenSim.Tests.Common
ast.Source = scriptSource;
ast.Encode();
- UUID assetUuid = new UUID("00000000-0000-0000-1000-000000000000");
- UUID itemUuid = new UUID("00000000-0000-0000-1100-000000000000");
+ UUID assetUuid = UUID.Random();
+ UUID itemUuid = UUID.Random();
+
AssetBase asset
= AssetHelpers.CreateAsset(assetUuid, AssetType.LSLText, ast.AssetData, UUID.Zero);
scene.AssetService.Store(asset);
--
cgit v1.1