From dfa19e23f03643762a10677203c088161a99557e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 8 Feb 2012 21:58:59 +0000
Subject: Stop a scene object from attempting to link with itself (which
results in an exception and constant complaints in v3 viewers).
Aims to address http://opensimulator.org/mantis/view.php?id=5878
---
.../Scenes/Tests/SceneObjectLinkingTests.cs | 23 +++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/Tests')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index a2332bb..be5b4a8 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -39,14 +39,31 @@ using log4net;
namespace OpenSim.Region.Framework.Scenes.Tests
{
- ///
- /// Linking tests
- ///
[TestFixture]
public class SceneObjectLinkingTests
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ ///
+ /// Links to self should be ignored.
+ ///
+ [Test]
+ public void TestLinkToSelf()
+ {
+ TestHelpers.InMethod();
+
+ UUID ownerId = TestHelpers.ParseTail(0x1);
+ int nParts = 3;
+
+ TestScene scene = SceneHelpers.SetupScene();
+ SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(nParts, ownerId, "TestLinkToSelf_", 0x10);
+ scene.AddSceneObject(sog1);
+ scene.LinkObjects(ownerId, sog1.LocalId, new List() { sog1.Parts[1].LocalId });
+// sog1.LinkToGroup(sog1);
+
+ Assert.That(sog1.Parts.Length, Is.EqualTo(nParts));
+ }
+
[Test]
public void TestLinkDelink2SceneObjects()
{
--
cgit v1.1