From 9664273df6d74e33aacaf1d4a38a287e218009d4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Apr 2014 23:34:30 +0100 Subject: Add basic regression test for creating a var region --- OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | 15 +++++++++++++++ OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 11 ++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs index 5ace6a3..eae61cd 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs @@ -59,6 +59,21 @@ namespace OpenSim.Region.Framework.Scenes.Tests new SceneHelpers().SetupScene(); } + [Test] + public void TestCreateVarScene() + { + TestHelpers.InMethod(); + UUID regionUuid = TestHelpers.ParseTail(0x1); + uint sizeX = 512; + uint sizeY = 512; + + Scene scene + = new SceneHelpers().SetupScene("scene", regionUuid, 1000, 1000, sizeX, sizeY, new IniConfigSource()); + + Assert.AreEqual(sizeX, scene.RegionInfo.RegionSizeX); + Assert.AreEqual(sizeY, scene.RegionInfo.RegionSizeY); + } + /// /// Very basic scene update test. Should become more elaborate with time. /// diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index eb8078d..874ff62 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -119,6 +119,11 @@ namespace OpenSim.Tests.Common return SetupScene(name, id, x, y, new IniConfigSource()); } + public TestScene SetupScene(string name, UUID id, uint x, uint y, IConfigSource configSource) + { + return SetupScene(name, id, x, y, Constants.RegionSize, Constants.RegionSize, configSource); + } + /// /// Set up a scene. /// @@ -126,10 +131,12 @@ namespace OpenSim.Tests.Common /// ID of the region /// X co-ordinate of the region /// Y co-ordinate of the region + /// X size of scene + /// Y size of scene /// /// public TestScene SetupScene( - string name, UUID id, uint x, uint y, IConfigSource configSource) + string name, UUID id, uint x, uint y, uint sizeX, uint sizeY, IConfigSource configSource) { Console.WriteLine("Setting up test scene {0}", name); @@ -139,6 +146,8 @@ namespace OpenSim.Tests.Common RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); regInfo.RegionName = name; regInfo.RegionID = id; + regInfo.RegionSizeX = sizeX; + regInfo.RegionSizeY = sizeY; SceneCommunicationService scs = new SceneCommunicationService(); -- cgit v1.1