add a test for updating region settings and fix a bug in uuid

translation in sqlite uncovered by this test.
0.6.0-stable
Sean Dague 2008-09-29 21:55:59 +00:00
parent 464c3c7091
commit 97107961e0
2 changed files with 21 additions and 1 deletions

View File

@ -258,7 +258,7 @@ namespace OpenSim.Data.SQLite
{ {
DataTable regionsettings = ds.Tables["regionsettings"]; DataTable regionsettings = ds.Tables["regionsettings"];
DataRow settingsRow = regionsettings.Rows.Find(Util.ToRawUuidString(rs.RegionUUID)); DataRow settingsRow = regionsettings.Rows.Find(rs.RegionUUID.ToString());
if (settingsRow == null) if (settingsRow == null)
{ {
settingsRow = regionsettings.NewRow(); settingsRow = regionsettings.NewRow();

View File

@ -142,6 +142,26 @@ namespace OpenSim.Data.Tests
Assert.That(r2.RegionUUID, Is.EqualTo(region2)); Assert.That(r2.RegionUUID, Is.EqualTo(region2));
} }
[Test]
public void T101_UpdateRegionInfo()
{
bool blockfly = true;
double sunpos = 0.5;
UUID cov = UUID.Random();
RegionSettings r1 = db.LoadRegionSettings(region1);
r1.BlockFly = blockfly;
r1.SunPosition = sunpos;
r1.Covenant = cov;
db.StoreRegionSettings(r1);
RegionSettings r2 = db.LoadRegionSettings(region1);
Assert.That(r2.RegionUUID, Is.EqualTo(region1));
Assert.That(r2.SunPosition, Is.EqualTo(sunpos));
Assert.That(r2.BlockFly, Is.EqualTo(blockfly));
Assert.That(r2.Covenant, Is.EqualTo(cov));
}
[Test] [Test]
public void T300_NoTerrain() public void T300_NoTerrain()
{ {