Add test for correct physics status on linking two physics objects

Also fixes last build break.
0.7.4.1
Justin Clark-Casey (justincc) 2012-04-21 01:09:19 +01:00
parent 71900968b2
commit 17bf2a62db
1 changed files with 26 additions and 2 deletions

View File

@ -26,6 +26,7 @@
*/ */
using System; using System;
using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using NUnit.Framework; using NUnit.Framework;
using OpenMetaverse; using OpenMetaverse;
@ -44,13 +45,16 @@ namespace OpenSim.Region.Framework.Scenes.Tests
public class SceneObjectStatusTests public class SceneObjectStatusTests
{ {
private TestScene m_scene; private TestScene m_scene;
private UUID m_ownerId = TestHelpers.ParseTail(0x1);
private SceneObjectGroup m_so1; private SceneObjectGroup m_so1;
private SceneObjectGroup m_so2;
[SetUp] [SetUp]
public void Init() public void Init()
{ {
m_scene = SceneHelpers.SetupScene(); m_scene = SceneHelpers.SetupScene();
SceneObjectGroup m_so1 = SceneHelpers.CreateSceneObject(1, UUID.Zero); m_so1 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so1", 0x10);
m_so2 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so2", 0x20);
} }
[Test] [Test]
@ -86,7 +90,27 @@ namespace OpenSim.Region.Framework.Scenes.Tests
m_so1.ScriptSetPhysicsStatus(false); m_so1.ScriptSetPhysicsStatus(false);
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
}
/// <summary>
/// Test that linking results in the correct physical status for all linkees.
/// </summary>
[Test]
public void TestLinkPhysicsBothPhysical()
{
TestHelpers.InMethod();
m_scene.AddSceneObject(m_so1);
m_scene.AddSceneObject(m_so2);
m_so1.ScriptSetPhysicsStatus(true);
m_so2.ScriptSetPhysicsStatus(true);
m_scene.LinkObjects(m_ownerId, m_so1.LocalId, new List<uint>() { m_so2.LocalId });
Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.Physics));
Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.Physics));
} }
} }
} }