Add test for setting physics in a linkset

0.7.4.1
Justin Clark-Casey (justincc) 2012-04-21 02:45:16 +01:00
parent d5c724e5b8
commit 77a7de87e1
1 changed files with 28 additions and 2 deletions

View File

@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
} }
[Test] [Test]
public void TestSetPhantom() public void TestSetPhantomSinglePrim()
{ {
TestHelpers.InMethod(); TestHelpers.InMethod();
@ -76,7 +76,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
} }
[Test] [Test]
public void TestSetPhysics() public void TestSetPhysicsSinglePrim()
{ {
TestHelpers.InMethod(); TestHelpers.InMethod();
@ -93,6 +93,32 @@ namespace OpenSim.Region.Framework.Scenes.Tests
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
} }
[Test]
public void TestSetPhysicsLinkset()
{
TestHelpers.InMethod();
m_scene.AddSceneObject(m_so1);
m_scene.AddSceneObject(m_so2);
m_scene.LinkObjects(m_ownerId, m_so1.LocalId, new List<uint>() { m_so2.LocalId });
m_so1.ScriptSetPhysicsStatus(true);
Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.Physics));
Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.Physics));
m_so1.ScriptSetPhysicsStatus(false);
Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.None));
Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.None));
m_so1.ScriptSetPhysicsStatus(true);
Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.Physics));
Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.Physics));
}
/// <summary> /// <summary>
/// Test that linking results in the correct physical status for all linkees. /// Test that linking results in the correct physical status for all linkees.
/// </summary> /// </summary>