diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs index 7f778d7..85cf507 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs | |||
@@ -184,5 +184,46 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
184 | 184 | ||
185 | Assert.That(savedAppearance.AvatarHeight, Is.EqualTo(sp.Appearance.AvatarHeight)); | 185 | Assert.That(savedAppearance.AvatarHeight, Is.EqualTo(sp.Appearance.AvatarHeight)); |
186 | } | 186 | } |
187 | |||
188 | [Test] | ||
189 | public void TestOsAgentSaveAppearance() | ||
190 | { | ||
191 | TestHelpers.InMethod(); | ||
192 | // log4net.Config.XmlConfigurator.Configure(); | ||
193 | |||
194 | UUID ownerId = TestHelpers.ParseTail(0x1); | ||
195 | UUID nonOwnerId = TestHelpers.ParseTail(0x2); | ||
196 | float newHeight = 1.9f; | ||
197 | |||
198 | ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, nonOwnerId); | ||
199 | sp.Appearance.AvatarHeight = newHeight; | ||
200 | SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, ownerId); | ||
201 | SceneObjectPart part = so.RootPart; | ||
202 | m_scene.AddSceneObject(so); | ||
203 | |||
204 | OSSL_Api osslApi = new OSSL_Api(); | ||
205 | osslApi.Initialize(m_engine, part, part.LocalId, part.UUID); | ||
206 | |||
207 | string notecardName = "appearanceNc"; | ||
208 | |||
209 | osslApi.osAgentSaveAppearance(new LSL_Types.LSLString(nonOwnerId.ToString()), notecardName); | ||
210 | |||
211 | IList<TaskInventoryItem> items = part.Inventory.GetInventoryItems(notecardName); | ||
212 | Assert.That(items.Count, Is.EqualTo(1)); | ||
213 | |||
214 | TaskInventoryItem ncItem = items[0]; | ||
215 | Assert.That(ncItem.Name, Is.EqualTo(notecardName)); | ||
216 | |||
217 | AssetBase ncAsset = m_scene.AssetService.Get(ncItem.AssetID.ToString()); | ||
218 | Assert.That(ncAsset, Is.Not.Null); | ||
219 | |||
220 | AssetNotecard anc = new AssetNotecard(UUID.Zero, ncAsset.Data); | ||
221 | anc.Decode(); | ||
222 | OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(anc.BodyText); | ||
223 | AvatarAppearance savedAppearance = new AvatarAppearance(); | ||
224 | savedAppearance.Unpack(appearanceOsd); | ||
225 | |||
226 | Assert.That(savedAppearance.AvatarHeight, Is.EqualTo(sp.Appearance.AvatarHeight)); | ||
227 | } | ||
187 | } | 228 | } |
188 | } \ No newline at end of file | 229 | } \ No newline at end of file |