aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-11-24 02:57:43 +0000
committerJustin Clark-Casey (justincc)2012-11-24 02:57:43 +0000
commite9be85442f31d0a8655df8c8f640b9a502ad8774 (patch)
tree377f3b6ad10692f505e5054999badbbd4c63deaa
parentFix bug where loading an OAR with a deeded parcel would always set the parcel... (diff)
downloadopensim-SC-e9be85442f31d0a8655df8c8f640b9a502ad8774.zip
opensim-SC-e9be85442f31d0a8655df8c8f640b9a502ad8774.tar.gz
opensim-SC-e9be85442f31d0a8655df8c8f640b9a502ad8774.tar.bz2
opensim-SC-e9be85442f31d0a8655df8c8f640b9a502ad8774.tar.xz
In ArchiverTests, use the local instantiated SceneManager rather than potentially cross-contaminating tests by relying on the static SceneManager.Instance
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs27
1 files changed, 7 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index 7cc3519..eec1cec 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -72,9 +72,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
72 { 72 {
73 base.SetUp(); 73 base.SetUp();
74 74
75 // FIXME: Do something about this - relying on statics in unit tests causes trouble sooner or later
76 new SceneManager();
77
78 m_archiverModule = new ArchiverModule(); 75 m_archiverModule = new ArchiverModule();
79 m_serialiserModule = new SerialiserModule(); 76 m_serialiserModule = new SerialiserModule();
80 TerrainModule terrainModule = new TerrainModule(); 77 TerrainModule terrainModule = new TerrainModule();
@@ -518,8 +515,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
518 SerialiserModule serialiserModule = new SerialiserModule(); 515 SerialiserModule serialiserModule = new SerialiserModule();
519 TerrainModule terrainModule = new TerrainModule(); 516 TerrainModule terrainModule = new TerrainModule();
520 517
521 m_sceneHelpers = new SceneHelpers(); 518 SceneHelpers m_sceneHelpers2 = new SceneHelpers();
522 TestScene scene2 = m_sceneHelpers.SetupScene(); 519 TestScene scene2 = m_sceneHelpers2.SetupScene();
523 SceneHelpers.SetupSceneModules(scene2, archiverModule, serialiserModule, terrainModule); 520 SceneHelpers.SetupSceneModules(scene2, archiverModule, serialiserModule, terrainModule);
524 521
525 // Make sure there's a valid owner for the owner we saved (this should have been wiped if the code is 522 // Make sure there's a valid owner for the owner we saved (this should have been wiped if the code is
@@ -552,7 +549,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
552 public void TestLoadOarDeededLand() 549 public void TestLoadOarDeededLand()
553 { 550 {
554 TestHelpers.InMethod(); 551 TestHelpers.InMethod();
555 TestHelpers.EnableLogging(); 552// TestHelpers.EnableLogging();
556 553
557 UUID landID = TestHelpers.ParseTail(0x10); 554 UUID landID = TestHelpers.ParseTail(0x10);
558 555
@@ -581,17 +578,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
581 new ArchiveWriteRequest(m_scene, (Stream)null, Guid.Empty).CreateControlFile(new ArchiveScenesGroup())); 578 new ArchiveWriteRequest(m_scene, (Stream)null, Guid.Empty).CreateControlFile(new ArchiveScenesGroup()));
582 579
583 LandObject lo = new LandObject(groupID, true, null); 580 LandObject lo = new LandObject(groupID, true, null);
584
585 // FIXME: We set directly rather than call SetLandBitmap in order not to do an AABB value update, which
586 // requests the terrain heightmap from an active scene. This is confusing and not a long-term solution.
587 //lo.LandBitmap = lo.BasicFullRegionLandBitmap();
588 lo.SetLandBitmap(lo.BasicFullRegionLandBitmap()); 581 lo.SetLandBitmap(lo.BasicFullRegionLandBitmap());
589
590 // FIXME: We have to make a separate call to update the LandData's copy of the land bitmap, even though this is
591 // identical to the LandObject copy. This should be changed so there's only one copy of the data if at all
592 // possible
593 //lo.UpdateLandBitmapByteArray();
594
595 LandData ld = lo.LandData; 582 LandData ld = lo.LandData;
596 ld.GlobalID = landID; 583 ld.GlobalID = landID;
597 584
@@ -944,7 +931,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
944 } 931 }
945 932
946 ArchiveScenesGroup scenesGroup = new ArchiveScenesGroup(); 933 ArchiveScenesGroup scenesGroup = new ArchiveScenesGroup();
947 SceneManager.Instance.ForEachScene(delegate(Scene scene) 934 m_sceneHelpers.SceneManager.ForEachScene(delegate(Scene scene)
948 { 935 {
949 scenesGroup.AddScene(scene); 936 scenesGroup.AddScene(scene);
950 }); 937 });
@@ -1002,13 +989,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
1002 989
1003 // Delete the current objects, to test that they're loaded from the OAR and didn't 990 // Delete the current objects, to test that they're loaded from the OAR and didn't
1004 // just remain in the scene. 991 // just remain in the scene.
1005 SceneManager.Instance.ForEachScene(delegate(Scene scene) 992 m_sceneHelpers.SceneManager.ForEachScene(delegate(Scene scene)
1006 { 993 {
1007 scene.DeleteAllSceneObjects(); 994 scene.DeleteAllSceneObjects();
1008 }); 995 });
1009 996
1010 // Create a "hole", to test that that the corresponding region isn't loaded from the OAR 997 // Create a "hole", to test that that the corresponding region isn't loaded from the OAR
1011 SceneManager.Instance.CloseScene(SceneManager.Instance.Scenes[1]); 998 m_sceneHelpers.SceneManager.CloseScene(SceneManager.Instance.Scenes[1]);
1012 999
1013 1000
1014 // Check thay the OAR file contains the expected data 1001 // Check thay the OAR file contains the expected data
@@ -1023,7 +1010,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
1023 1010
1024 Assert.That(m_lastErrorMessage, Is.Null); 1011 Assert.That(m_lastErrorMessage, Is.Null);
1025 1012
1026 Assert.AreEqual(3, SceneManager.Instance.Scenes.Count); 1013 Assert.AreEqual(3, m_sceneHelpers.SceneManager.Scenes.Count);
1027 1014
1028 TestLoadedRegion(part1, soundItemName, soundData); 1015 TestLoadedRegion(part1, soundItemName, soundData);
1029 } 1016 }