diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs index d9b17d7..14b1890 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs | |||
@@ -41,10 +41,10 @@ using OpenSim.Region.OptionalModules.World.NPC; | |||
41 | using OpenSim.Region.Framework.Scenes; | 41 | using OpenSim.Region.Framework.Scenes; |
42 | using OpenSim.Region.ScriptEngine.Shared; | 42 | using OpenSim.Region.ScriptEngine.Shared; |
43 | using OpenSim.Region.ScriptEngine.Shared.Api; | 43 | using OpenSim.Region.ScriptEngine.Shared.Api; |
44 | using OpenSim.Region.ScriptEngine.Shared.Instance; | ||
44 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | 45 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; |
45 | using OpenSim.Services.Interfaces; | 46 | using OpenSim.Services.Interfaces; |
46 | using OpenSim.Tests.Common; | 47 | using OpenSim.Tests.Common; |
47 | using OpenSim.Tests.Common.Mock; | ||
48 | 48 | ||
49 | namespace OpenSim.Region.ScriptEngine.Shared.Tests | 49 | namespace OpenSim.Region.ScriptEngine.Shared.Tests |
50 | { | 50 | { |
@@ -92,7 +92,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
92 | // FIXME: This should really be a script item (with accompanying script) | 92 | // FIXME: This should really be a script item (with accompanying script) |
93 | TaskInventoryItem grp1Item | 93 | TaskInventoryItem grp1Item |
94 | = TaskInventoryHelpers.AddNotecard( | 94 | = TaskInventoryHelpers.AddNotecard( |
95 | m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900)); | 95 | m_scene.AssetService, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); |
96 | grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; | 96 | grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; |
97 | 97 | ||
98 | SceneObjectGroup grp2 = SceneHelpers.CreateSceneObject(2, ownerId, "grp2-", 0x20); | 98 | SceneObjectGroup grp2 = SceneHelpers.CreateSceneObject(2, ownerId, "grp2-", 0x20); |
@@ -126,7 +126,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
126 | // FIXME: This should really be a script item (with accompanying script) | 126 | // FIXME: This should really be a script item (with accompanying script) |
127 | TaskInventoryItem grp1Item | 127 | TaskInventoryItem grp1Item |
128 | = TaskInventoryHelpers.AddNotecard( | 128 | = TaskInventoryHelpers.AddNotecard( |
129 | m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900)); | 129 | m_scene.AssetService, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); |
130 | 130 | ||
131 | grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; | 131 | grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; |
132 | 132 | ||
@@ -140,5 +140,47 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
140 | SceneObjectGroup grp2 = m_scene.GetSceneObjectGroup("grp1-Part1"); | 140 | SceneObjectGroup grp2 = m_scene.GetSceneObjectGroup("grp1-Part1"); |
141 | Assert.That(grp2, Is.Not.Null); | 141 | Assert.That(grp2, Is.Not.Null); |
142 | } | 142 | } |
143 | |||
144 | [Test] | ||
145 | public void TestllBreakAllLinks() | ||
146 | { | ||
147 | TestHelpers.InMethod(); | ||
148 | |||
149 | UUID ownerId = TestHelpers.ParseTail(0x1); | ||
150 | |||
151 | SceneObjectGroup grp1 = SceneHelpers.CreateSceneObject(3, ownerId, "grp1-", 0x10); | ||
152 | grp1.AbsolutePosition = new Vector3(10, 10, 10); | ||
153 | m_scene.AddSceneObject(grp1); | ||
154 | |||
155 | // FIXME: This should really be a script item (with accompanying script) | ||
156 | TaskInventoryItem grp1Item | ||
157 | = TaskInventoryHelpers.AddNotecard( | ||
158 | m_scene.AssetService, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); | ||
159 | |||
160 | grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; | ||
161 | |||
162 | LSL_Api apiGrp1 = new LSL_Api(); | ||
163 | apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item); | ||
164 | |||
165 | apiGrp1.llBreakAllLinks(); | ||
166 | |||
167 | { | ||
168 | SceneObjectGroup nowGrp = m_scene.GetSceneObjectGroup("grp1-Part1"); | ||
169 | Assert.That(nowGrp, Is.Not.Null); | ||
170 | Assert.That(nowGrp.Parts.Length, Is.EqualTo(1)); | ||
171 | } | ||
172 | |||
173 | { | ||
174 | SceneObjectGroup nowGrp = m_scene.GetSceneObjectGroup("grp1-Part2"); | ||
175 | Assert.That(nowGrp, Is.Not.Null); | ||
176 | Assert.That(nowGrp.Parts.Length, Is.EqualTo(1)); | ||
177 | } | ||
178 | |||
179 | { | ||
180 | SceneObjectGroup nowGrp = m_scene.GetSceneObjectGroup("grp1-Part3"); | ||
181 | Assert.That(nowGrp, Is.Not.Null); | ||
182 | Assert.That(nowGrp.Parts.Length, Is.EqualTo(1)); | ||
183 | } | ||
184 | } | ||
143 | } | 185 | } |
144 | } \ No newline at end of file | 186 | } |