From 038d1bf742ba4f95ca8a83b27f6fefb755485524 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 7 Feb 2012 17:44:37 +0000 Subject: Add a regression test to compile and start a script. Remove Path.GetDirectoryName when getting assembly loading path in Compiler.CompileFromDotNetText(). The Path.GetDirectoryName call in Compiler.CompileFromDotNetText is unnecessary since AppDomain.CurrentDomain.BaseDirectory is always a directory. Later path concatenation is already done by Path.Combine() which handles any trailing slash. Removing Path.GetDirectoryName() will not affect the runtime but allows NUnit to work since it doesn't add a trailing slash to AppDomain.CurrentDomain.BaseDirectory. --- OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 0c36dcd..f2d1915 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -267,10 +267,8 @@ namespace OpenSim.Region.Framework.Scenes /// public void CreateScriptInstance(TaskInventoryItem item, int startParam, bool postOnRez, string engine, int stateSource) { - // m_log.InfoFormat( - // "[PRIM INVENTORY]: " + - // "Starting script {0}, {1} in prim {2}, {3}", - // item.Name, item.ItemID, Name, UUID); +// m_log.DebugFormat("[PRIM INVENTORY]: Starting script {0} {1} in prim {2} {3} in {4}", +// item.Name, item.ItemID, m_part.Name, m_part.UUID, m_part.ParentGroup.Scene.RegionInfo.RegionName); if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) return; @@ -299,8 +297,7 @@ namespace OpenSim.Region.Framework.Scenes if (null == asset) { m_log.ErrorFormat( - "[PRIM INVENTORY]: " + - "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", + "[PRIM INVENTORY]: Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", item.Name, item.ItemID, m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); } @@ -400,8 +397,7 @@ namespace OpenSim.Region.Framework.Scenes CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); else m_log.ErrorFormat( - "[PRIM INVENTORY]: " + - "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", + "[PRIM INVENTORY]: Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", itemId, m_part.Name, m_part.UUID, m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); } -- cgit v1.1 From 7583768b9e40e1033cc417047226d8ab80b36294 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 7 Feb 2012 20:26:26 +0000 Subject: Remove debug logging if physics actor is null in SOP.ApplyPhysics() This is not valid in the case of BasicPhysics which can return a null PhysicsActor (though I think it should really return a do-nothing PhysicsActor). --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 0e899ca..4c339d9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1501,7 +1501,7 @@ namespace OpenSim.Region.Framework.Scenes PhysActor = null; } - // Basic Physics returns null.. joy joy joy. + // Basic Physics can also return null as well as an exception catch. if (PhysActor != null) { PhysActor.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info @@ -1509,10 +1509,6 @@ namespace OpenSim.Region.Framework.Scenes DoPhysicsPropertyUpdate(RigidBody, true); PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0); } - else - { - m_log.DebugFormat("[SOP]: physics actor is null for {0} with parent {1}", UUID, this.ParentGroup.UUID); - } } } } -- cgit v1.1 From bd928218dd0845bb0aef46749e8a393d0a9e4fbc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 7 Feb 2012 21:00:47 +0000 Subject: Add TestAddTaskInventoryItem() --- .../Framework/Scenes/Tests/TaskInventoryTests.cs | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index 1abef8d..e4b607d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs @@ -53,6 +53,30 @@ namespace OpenSim.Region.Framework.Tests public class TaskInventoryTests { [Test] + public void TestAddTaskInventoryItem() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + Scene scene = SceneHelpers.SetupScene(); + UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); + SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); + SceneObjectPart sop1 = sog1.RootPart; + + // Create an object embedded inside the first + UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); + TaskInventoryItem taskSceneObjectItem + = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); + + TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId); + Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId)); + Assert.That(addedItem.OwnerID, Is.EqualTo(user1.PrincipalID)); + Assert.That(addedItem.ParentID, Is.EqualTo(sop1.UUID)); + Assert.That(addedItem.InvType, Is.EqualTo((int)InventoryType.Object)); + Assert.That(addedItem.Type, Is.EqualTo((int)AssetType.Object)); + } + + [Test] public void TestRezObjectFromInventoryItem() { TestHelpers.InMethod(); @@ -66,7 +90,7 @@ namespace OpenSim.Region.Framework.Tests // Create an object embedded inside the first UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); TaskInventoryItem taskSceneObjectItem - = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId); + = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); scene.AddSceneObject(sog1); -- cgit v1.1