Fix unit tests and save problems

(note; contrary to previous commits, saving 0.4 OARs is actually broken since serialized objects in inventories are not yet converted properly).
Firstly, if you can save a version 1.0 OAR then you can load it too.
Secondly, closing the save stream even on success before assets/objects are saved is a bad idea
viewer-2-initial-appearance
Justin Clark-Casey (justincc) 2010-11-20 02:59:21 +00:00
parent 1087d6042b
commit d7bca3d8e8
3 changed files with 4 additions and 3 deletions

View File

@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version /// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version
/// bumps here should be compatible. /// bumps here should be compatible.
/// </summary> /// </summary>
public static int MAX_MAJOR_VERSION = 0; public static int MAX_MAJOR_VERSION = 1;
protected Scene m_scene; protected Scene m_scene;
protected Stream m_loadStream; protected Stream m_loadStream;

View File

@ -192,9 +192,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
new AssetsArchiver(archiveWriter), assetUuids, new AssetsArchiver(archiveWriter), assetUuids,
m_scene.AssetService, awre.ReceivedAllAssets).Execute(); m_scene.AssetService, awre.ReceivedAllAssets).Execute();
} }
finally catch (Exception)
{ {
m_saveStream.Close(); m_saveStream.Close();
throw;
} }
} }

View File

@ -128,7 +128,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
public void TestSaveOarV0_2() public void TestSaveOarV0_2()
{ {
TestHelper.InMethod(); TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
SceneObjectPart part1 = CreateSceneObjectPart1(); SceneObjectPart part1 = CreateSceneObjectPart1();
SceneObjectGroup sog1 = new SceneObjectGroup(part1); SceneObjectGroup sog1 = new SceneObjectGroup(part1);