From ffdf59a57c936189e3b161b79b4a76a3a9b260bb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 22 Oct 2011 02:16:46 +0100 Subject: Get UUIDGatherer to scan notecards in the graph for asset uuids. This is to support npc baked texture saving in oars and iars. May address http://opensimulator.org/mantis/view.php?id=5743 --- .../Framework/Scenes/Tests/UuidGathererTests.cs | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 24de56e..d9fe87c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs @@ -85,5 +85,31 @@ namespace OpenSim.Region.Framework.Scenes.Tests // We count the uuid as gathered even if the asset itself is missing. Assert.That(foundAssetUuids.Count, Is.EqualTo(1)); } + + [Test] + public void TestNotecardAsset() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + UUID ownerId = TestHelpers.ParseTail(0x10); + UUID soAssetId = TestHelpers.ParseTail(0x20); + UUID ncAssetId = TestHelpers.ParseTail(0x30); + + SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, ownerId); + AssetBase soAsset = AssetHelpers.CreateAsset(soAssetId, so); + m_assetService.Store(soAsset); + + AssetBase ncAsset = AssetHelpers.CreateNotecardAsset(ncAssetId, soAssetId.ToString()); + m_assetService.Store(ncAsset); + + IDictionary foundAssetUuids = new Dictionary(); + m_uuidGatherer.GatherAssetUuids(ncAssetId, AssetType.Notecard, foundAssetUuids); + + // We count the uuid as gathered even if the asset itself is corrupt. + Assert.That(foundAssetUuids.Count, Is.EqualTo(2)); + Assert.That(foundAssetUuids.ContainsKey(ncAssetId)); + Assert.That(foundAssetUuids.ContainsKey(soAssetId)); + } } } -- cgit v1.1