From 3ae98611f2efd7c8fb7acc172f9252241dd5c918 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 Apr 2012 01:43:03 +0100 Subject: Add simple RelativePosition and OffsetPosition checks to TestGetRootPartPosition --- OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index 10c78b5..19526c0 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs @@ -60,6 +60,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(so.AbsolutePosition, Is.EqualTo(partPosition)); Assert.That(so.RootPart.AbsolutePosition, Is.EqualTo(partPosition)); + Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero)); + Assert.That(so.RootPart.RelativePosition, Is.EqualTo(partPosition)); } } } \ No newline at end of file -- cgit v1.1 From 317aebcce6618cacbe3afd831c3e100b96665be2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 Apr 2012 01:47:56 +0100 Subject: refactor: put SOG position test in a separate TestSceneObjectGroupPosition() --- .../Framework/Scenes/Tests/SceneObjectSpatialTests.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index 19526c0..3509de1 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs @@ -45,6 +45,23 @@ namespace OpenSim.Region.Framework.Scenes.Tests public class SceneObjectSpatialTests { [Test] + public void TestSceneObjectGroupPosition() + { + TestHelpers.InMethod(); + + Scene scene = SceneHelpers.SetupScene(); + UUID ownerId = TestHelpers.ParseTail(0x1); + Vector3 position = new Vector3(10, 20, 30); + + SceneObjectGroup so + = SceneHelpers.CreateSceneObject(1, ownerId, "obj1", 0x10); + so.AbsolutePosition = position; + scene.AddNewSceneObject(so, false); + + Assert.That(so.AbsolutePosition, Is.EqualTo(position)); + } + + [Test] public void TestGetRootPartPosition() { TestHelpers.InMethod(); @@ -58,7 +75,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests so.AbsolutePosition = partPosition; scene.AddNewSceneObject(so, false); - Assert.That(so.AbsolutePosition, Is.EqualTo(partPosition)); Assert.That(so.RootPart.AbsolutePosition, Is.EqualTo(partPosition)); Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero)); Assert.That(so.RootPart.RelativePosition, Is.EqualTo(partPosition)); -- cgit v1.1 From f61b2342524023b89725e3473b8332fe6a8e71ca Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 Apr 2012 01:52:16 +0100 Subject: refactor: move common init code into SetUp() in SceneObjectSpatialTests --- .../Scenes/Tests/SceneObjectSpatialTests.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index 3509de1..69b5b1f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs @@ -44,19 +44,26 @@ namespace OpenSim.Region.Framework.Scenes.Tests [TestFixture] public class SceneObjectSpatialTests { + TestScene m_scene; + UUID m_ownerId = TestHelpers.ParseTail(0x1); + + [SetUp] + public void SetUp() + { + m_scene = SceneHelpers.SetupScene(); + } + [Test] public void TestSceneObjectGroupPosition() { TestHelpers.InMethod(); - Scene scene = SceneHelpers.SetupScene(); - UUID ownerId = TestHelpers.ParseTail(0x1); Vector3 position = new Vector3(10, 20, 30); SceneObjectGroup so - = SceneHelpers.CreateSceneObject(1, ownerId, "obj1", 0x10); + = SceneHelpers.CreateSceneObject(1, m_ownerId, "obj1", 0x10); so.AbsolutePosition = position; - scene.AddNewSceneObject(so, false); + m_scene.AddNewSceneObject(so, false); Assert.That(so.AbsolutePosition, Is.EqualTo(position)); } @@ -66,14 +73,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests { TestHelpers.InMethod(); - Scene scene = SceneHelpers.SetupScene(); - UUID ownerId = TestHelpers.ParseTail(0x1); Vector3 partPosition = new Vector3(10, 20, 30); SceneObjectGroup so - = SceneHelpers.CreateSceneObject(1, ownerId, "obj1", 0x10); + = SceneHelpers.CreateSceneObject(1, m_ownerId, "obj1", 0x10); so.AbsolutePosition = partPosition; - scene.AddNewSceneObject(so, false); + m_scene.AddNewSceneObject(so, false); Assert.That(so.RootPart.AbsolutePosition, Is.EqualTo(partPosition)); Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero)); -- cgit v1.1 From da342d0b21b867061a3f3a502256331c609e1564 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 Apr 2012 01:53:40 +0100 Subject: minor: make test names consistent --- OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index 69b5b1f..c38a22d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs @@ -54,7 +54,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests } [Test] - public void TestSceneObjectGroupPosition() + public void TestGetSceneObjectGroupPosition() { TestHelpers.InMethod(); -- cgit v1.1 From 2c74e1bba8d93a1c3b95da913bc3de0aae6dca4a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 Apr 2012 01:57:09 +0100 Subject: Add GroupPosition and GetWorldPosition() checks to TestGetRootPartPosition() --- OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index c38a22d..7a3b362 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs @@ -81,8 +81,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests m_scene.AddNewSceneObject(so, false); Assert.That(so.RootPart.AbsolutePosition, Is.EqualTo(partPosition)); - Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero)); + Assert.That(so.RootPart.GroupPosition, Is.EqualTo(partPosition)); + Assert.That(so.RootPart.GetWorldPosition(), Is.EqualTo(partPosition)); Assert.That(so.RootPart.RelativePosition, Is.EqualTo(partPosition)); + Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero)); } } } \ No newline at end of file -- cgit v1.1