From 3c271bf2229bc58969ca7d15b7082815f6b4c1f0 Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Fri, 2 Oct 2009 11:26:45 +0200 Subject: fixing TestLandChannel to let it return empty List() (as does the real LandChannel), percolating to SceneSetupHelpers. --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 46 ++++++++++++++++++++++--- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 2 +- 2 files changed, 42 insertions(+), 6 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 01b5203..ed30827 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -29,6 +29,8 @@ using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.CoreModules.World.Land; namespace OpenSim.Tests.Common.Mock { @@ -37,11 +39,45 @@ namespace OpenSim.Tests.Common.Mock /// public class TestLandChannel : ILandChannel { - public List ParcelsNearPoint(Vector3 position) { return null; } - public List AllParcels() { return null; } - public ILandObject GetLandObject(int x, int y) { return null; } - public ILandObject GetLandObject(int localID) { return null; } - public ILandObject GetLandObject(float x, float y) { return null; } + private Scene m_scene; + + public TestLandChannel(Scene scene) + { + m_scene = scene; + } + + public List ParcelsNearPoint(Vector3 position) + { + return new List(); + } + + public List AllParcels() + { + return new List(); + } + + protected ILandObject GetNoLand() + { + ILandObject obj = new LandObject(UUID.Zero, false, m_scene); + obj.LandData.Name = "NO LAND"; + return obj; + } + + public ILandObject GetLandObject(int x, int y) + { + return GetNoLand(); + } + + public ILandObject GetLandObject(int localID) + { + return GetNoLand(); + } + + public ILandObject GetLandObject(float x, float y) + { + return GetNoLand(); + } + public bool IsLandPrimCountTainted() { return false; } public bool IsForcefulBansAllowed() { return false; } public void UpdateLandObject(int localID, LandData data) {} diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 952fac9..eab5422 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -198,7 +198,7 @@ namespace OpenSim.Tests.Common.Setup testScene.SetModuleInterfaces(); - testScene.LandChannel = new TestLandChannel(); + testScene.LandChannel = new TestLandChannel(testScene); testScene.LoadWorldMap(); PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); -- cgit v1.1