aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-04-21 01:09:19 +0100
committerJustin Clark-Casey (justincc)2012-04-21 01:09:42 +0100
commit17bf2a62db39ba58ca691a6754bf79fe6b3ee474 (patch)
tree3a8bdd987c03e953ed99b07a082dc6ac8a3a4138 /OpenSim/Region
parentrefactor: extract common setup code in SceneObjectStatusTests (diff)
downloadopensim-SC_OLD-17bf2a62db39ba58ca691a6754bf79fe6b3ee474.zip
opensim-SC_OLD-17bf2a62db39ba58ca691a6754bf79fe6b3ee474.tar.gz
opensim-SC_OLD-17bf2a62db39ba58ca691a6754bf79fe6b3ee474.tar.bz2
opensim-SC_OLD-17bf2a62db39ba58ca691a6754bf79fe6b3ee474.tar.xz
Add test for correct physics status on linking two physics objects
Also fixes last build break.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs28
1 files changed, 26 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
index b8e1b92..6270ac1 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.Reflection; 30using System.Reflection;
30using NUnit.Framework; 31using NUnit.Framework;
31using OpenMetaverse; 32using OpenMetaverse;
@@ -44,13 +45,16 @@ namespace OpenSim.Region.Framework.Scenes.Tests
44 public class SceneObjectStatusTests 45 public class SceneObjectStatusTests
45 { 46 {
46 private TestScene m_scene; 47 private TestScene m_scene;
48 private UUID m_ownerId = TestHelpers.ParseTail(0x1);
47 private SceneObjectGroup m_so1; 49 private SceneObjectGroup m_so1;
50 private SceneObjectGroup m_so2;
48 51
49 [SetUp] 52 [SetUp]
50 public void Init() 53 public void Init()
51 { 54 {
52 m_scene = SceneHelpers.SetupScene(); 55 m_scene = SceneHelpers.SetupScene();
53 SceneObjectGroup m_so1 = SceneHelpers.CreateSceneObject(1, UUID.Zero); 56 m_so1 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so1", 0x10);
57 m_so2 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so2", 0x20);
54 } 58 }
55 59
56 [Test] 60 [Test]
@@ -86,7 +90,27 @@ namespace OpenSim.Region.Framework.Scenes.Tests
86 90
87 m_so1.ScriptSetPhysicsStatus(false); 91 m_so1.ScriptSetPhysicsStatus(false);
88 92
89 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); 93 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
94 }
95
96 /// <summary>
97 /// Test that linking results in the correct physical status for all linkees.
98 /// </summary>
99 [Test]
100 public void TestLinkPhysicsBothPhysical()
101 {
102 TestHelpers.InMethod();
103
104 m_scene.AddSceneObject(m_so1);
105 m_scene.AddSceneObject(m_so2);
106
107 m_so1.ScriptSetPhysicsStatus(true);
108 m_so2.ScriptSetPhysicsStatus(true);
109
110 m_scene.LinkObjects(m_ownerId, m_so1.LocalId, new List<uint>() { m_so2.LocalId });
111
112 Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.Physics));
113 Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.Physics));
90 } 114 }
91 } 115 }
92} \ No newline at end of file 116} \ No newline at end of file