aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-12 22:35:11 +0000
committerJustin Clark-Casey (justincc)2012-01-12 22:35:11 +0000
commitbeab155434b1ea4338004496fd35df2a22170960 (patch)
tree9e3670eab814b4176c3e10e89d5a1c115d684988 /OpenSim/Region/ScriptEngine/Shared
parentAdd ossl level test for removing an unowned npc (diff)
downloadopensim-SC_OLD-beab155434b1ea4338004496fd35df2a22170960.zip
opensim-SC_OLD-beab155434b1ea4338004496fd35df2a22170960.tar.gz
opensim-SC_OLD-beab155434b1ea4338004496fd35df2a22170960.tar.bz2
opensim-SC_OLD-beab155434b1ea4338004496fd35df2a22170960.tar.xz
Add api level test for removing an owned npc
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs57
1 files changed, 55 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
index c4832c9..f0b28b2 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
@@ -77,10 +77,63 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
77 } 77 }
78 78
79 /// <summary> 79 /// <summary>
80 /// Test creation of an NPC where the appearance data comes from an avatar already in the region. 80 /// Test removal of an owned NPC.
81 /// </summary> 81 /// </summary>
82 [Test] 82 [Test]
83 public void TestOsNpcRemove() 83 public void TestOsNpcRemoveOwned()
84 {
85 TestHelpers.InMethod();
86// log4net.Config.XmlConfigurator.Configure();
87
88 // Store an avatar with a different height from default in a notecard.
89 UUID userId = TestHelpers.ParseTail(0x1);
90 UUID otherUserId = TestHelpers.ParseTail(0x2);
91 float newHeight = 1.9f;
92
93 SceneHelpers.AddScenePresence(m_scene, otherUserId);
94
95 ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId);
96 sp.Appearance.AvatarHeight = newHeight;
97
98 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId);
99 SceneObjectPart part = so.RootPart;
100 m_scene.AddSceneObject(so);
101
102 SceneObjectGroup otherSo = SceneHelpers.CreateSceneObject(1, otherUserId);
103 SceneObjectPart otherPart = otherSo.RootPart;
104 m_scene.AddSceneObject(otherSo);
105
106 OSSL_Api osslApi = new OSSL_Api();
107 osslApi.Initialize(m_engine, part, part.LocalId, part.UUID);
108
109 OSSL_Api otherOsslApi = new OSSL_Api();
110 otherOsslApi.Initialize(m_engine, otherPart, otherPart.LocalId, otherPart.UUID);
111
112 string notecardName = "appearanceNc";
113 osslApi.osOwnerSaveAppearance(notecardName);
114
115 string npcRaw
116 = osslApi.osNpcCreate(
117 "Jane", "Doe", new LSL_Types.Vector3(128, 128, 128), notecardName, ScriptBaseClass.OS_NPC_CREATOR_OWNED);
118
119 otherOsslApi.osNpcRemove(npcRaw);
120
121 // Should still be around
122 UUID npcId = new UUID(npcRaw);
123 ScenePresence npc = m_scene.GetScenePresence(npcId);
124 Assert.That(npc, Is.Not.Null);
125
126 osslApi.osNpcRemove(npcRaw);
127
128 npc = m_scene.GetScenePresence(npcId);
129
130 }
131
132 /// <summary>
133 /// Test removal of an unowned NPC.
134 /// </summary>
135 [Test]
136 public void TestOsNpcRemoveUnowned()
84 { 137 {
85 TestHelpers.InMethod(); 138 TestHelpers.InMethod();
86// log4net.Config.XmlConfigurator.Configure(); 139// log4net.Config.XmlConfigurator.Configure();