29 using System.Collections.Generic;
30 using System.Reflection;
34 using NUnit.Framework;
36 using OpenMetaverse.Assets;
37 using OpenMetaverse.StructuredData;
38 using OpenSim.Framework;
39 using OpenSim.Region.CoreModules.Avatar.AvatarFactory;
40 using OpenSim.Region.OptionalModules.World.NPC;
41 using OpenSim.Region.Framework.Scenes;
42 using OpenSim.Region.ScriptEngine.Shared;
43 using OpenSim.Region.ScriptEngine.Shared.Api;
44 using OpenSim.Region.ScriptEngine.Shared.Instance;
45 using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
46 using OpenSim.Services.Interfaces;
47 using OpenSim.Tests.Common;
49 namespace OpenSim.
Region.ScriptEngine.Shared.Tests
69 IConfigSource initConfigSource =
new IniConfigSource();
70 IConfig config = initConfigSource.AddConfig(
"XEngine");
71 config.Set(
"Enabled",
"true");
74 SceneHelpers.SetupSceneModules(m_scene, initConfigSource);
77 m_engine.Initialise(initConfigSource);
78 m_engine.AddRegion(m_scene);
84 TestHelpers.InMethod();
86 UUID ownerId = TestHelpers.ParseTail(0x1);
88 SceneObjectGroup grp1 = SceneHelpers.CreateSceneObject(2, ownerId,
"grp1-", 0x10);
89 grp1.AbsolutePosition =
new Vector3(10, 10, 10);
90 m_scene.AddSceneObject(grp1);
94 = TaskInventoryHelpers.AddNotecard(
95 m_scene.AssetService, grp1.RootPart,
"ncItem", TestHelpers.ParseTail(0x800),
TestHelpers.
ParseTail(0x900),
"Hello World!");
96 grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
98 SceneObjectGroup grp2 = SceneHelpers.CreateSceneObject(2, ownerId,
"grp2-", 0x20);
99 grp2.AbsolutePosition =
new Vector3(20, 20, 20);
102 grp2.UpdateGroupRotationR(Quaternion.CreateFromEulers(180 * Utils.DEG_TO_RAD, 0, 0));
104 m_scene.AddSceneObject(grp2);
107 apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item);
111 Assert.That(grp1.Parts.Length, Is.EqualTo(4));
112 Assert.That(grp2.IsDeleted, Is.True);
118 TestHelpers.InMethod();
120 UUID ownerId = TestHelpers.ParseTail(0x1);
122 SceneObjectGroup grp1 = SceneHelpers.CreateSceneObject(2, ownerId,
"grp1-", 0x10);
123 grp1.AbsolutePosition =
new Vector3(10, 10, 10);
124 m_scene.AddSceneObject(grp1);
128 = TaskInventoryHelpers.AddNotecard(
129 m_scene.AssetService, grp1.RootPart,
"ncItem", TestHelpers.ParseTail(0x800),
TestHelpers.
ParseTail(0x900),
"Hello World!");
131 grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
134 apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item);
136 apiGrp1.llBreakLink(2);
138 Assert.That(grp1.Parts.Length, Is.EqualTo(1));
141 Assert.That(grp2, Is.Not.Null);
147 TestHelpers.InMethod();
149 UUID ownerId = TestHelpers.ParseTail(0x1);
151 SceneObjectGroup grp1 = SceneHelpers.CreateSceneObject(3, ownerId,
"grp1-", 0x10);
152 grp1.AbsolutePosition =
new Vector3(10, 10, 10);
153 m_scene.AddSceneObject(grp1);
157 = TaskInventoryHelpers.AddNotecard(
158 m_scene.AssetService, grp1.RootPart,
"ncItem", TestHelpers.ParseTail(0x800),
TestHelpers.
ParseTail(0x900),
"Hello World!");
160 grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
163 apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item);
165 apiGrp1.llBreakAllLinks();
169 Assert.That(nowGrp, Is.Not.Null);
170 Assert.That(nowGrp.Parts.Length, Is.EqualTo(1));
175 Assert.That(nowGrp, Is.Not.Null);
176 Assert.That(nowGrp.Parts.Length, Is.EqualTo(1));
181 Assert.That(nowGrp, Is.Not.Null);
182 Assert.That(nowGrp.Parts.Length, Is.EqualTo(1));
Tests for linking functions in LSL
void TestllBreakAllLinks()
Contains all LSL ll-functions. This class will be in Default AppDomain.
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
Represents an item in a task inventory
static UUID ParseTail(int tail)
Parse tail section into full UUID.
Helpers for setting up scenes.
static readonly LSLInteger TRUE