Add basic regression test for creating a var region

0.8.0.3
Justin Clark-Casey (justincc) 2014-04-25 23:34:30 +01:00
parent 2227f51b29
commit 9664273df6
2 changed files with 25 additions and 1 deletions

View File

@ -59,6 +59,21 @@ namespace OpenSim.Region.Framework.Scenes.Tests
new SceneHelpers().SetupScene(); 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);
}
/// <summary> /// <summary>
/// Very basic scene update test. Should become more elaborate with time. /// Very basic scene update test. Should become more elaborate with time.
/// </summary> /// </summary>

View File

@ -119,6 +119,11 @@ namespace OpenSim.Tests.Common
return SetupScene(name, id, x, y, new IniConfigSource()); 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);
}
/// <summary> /// <summary>
/// Set up a scene. /// Set up a scene.
/// </summary> /// </summary>
@ -126,10 +131,12 @@ namespace OpenSim.Tests.Common
/// <param name="id">ID of the region</param> /// <param name="id">ID of the region</param>
/// <param name="x">X co-ordinate of the region</param> /// <param name="x">X co-ordinate of the region</param>
/// <param name="y">Y co-ordinate of the region</param> /// <param name="y">Y co-ordinate of the region</param>
/// <param name="sizeX">X size of scene</param>
/// <param name="sizeY">Y size of scene</param>
/// <param name="configSource"></param> /// <param name="configSource"></param>
/// <returns></returns> /// <returns></returns>
public TestScene SetupScene( 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); 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"); RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1");
regInfo.RegionName = name; regInfo.RegionName = name;
regInfo.RegionID = id; regInfo.RegionID = id;
regInfo.RegionSizeX = sizeX;
regInfo.RegionSizeY = sizeY;
SceneCommunicationService scs = new SceneCommunicationService(); SceneCommunicationService scs = new SceneCommunicationService();