From d25265ae82a3ac3afc32f65f820c9ed0b2bff31f Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 28 Jan 2014 15:58:45 -0800 Subject: Fix terrain tests by properly initializing low detail terrain to zero height. Also remove PI heightmap test as new heightmaps only have two significant digits. --- OpenSim/Region/CoreModules/World/Land/LandObject.cs | 5 ++++- OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index f8f4986..939512f 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -134,7 +134,10 @@ namespace OpenSim.Region.CoreModules.World.Land public LandObject(UUID owner_id, bool is_group_owned, Scene scene) { m_scene = scene; - m_landBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; + if (m_scene == null) + m_landBitmap = new bool[Constants.RegionSize / landUnit, Constants.RegionSize / landUnit]; + else + m_landBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; LandData.OwnerID = owner_id; if (is_group_owned) diff --git a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs index be719ea..d557168 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs @@ -100,10 +100,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Tests x[0, 0] -= 1.0; Assert.That(x[0, 0] == 4.0, "Terrain addition/subtraction error."); - x[0, 0] = Math.PI; - double[,] doublesExport = x.GetDoubles(); - Assert.That(doublesExport[0, 0] == Math.PI, "Export to double[,] array not working correctly."); - x[0, 0] = 1.0; float[] floatsExport = x.GetFloatsSerialised(); Assert.That(floatsExport[0] == 1.0f, "Export to float[] not working correctly."); -- cgit v1.1