diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 098f1b4..8961a26 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | |||
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
99 | Assert.That(scene.AddNewSceneObject(so, false), Is.True); | 99 | Assert.That(scene.AddNewSceneObject(so, false), Is.True); |
100 | SceneObjectGroup retrievedSo = scene.GetSceneObjectGroup(so.UUID); | 100 | SceneObjectGroup retrievedSo = scene.GetSceneObjectGroup(so.UUID); |
101 | SceneObjectPart[] retrievedParts = retrievedSo.Parts; | 101 | SceneObjectPart[] retrievedParts = retrievedSo.Parts; |
102 | 102 | ||
103 | //m_log.Debug("retrievedPart : {0}", retrievedPart); | 103 | //m_log.Debug("retrievedPart : {0}", retrievedPart); |
104 | // If the parts have the same UUID then we will consider them as one and the same | 104 | // If the parts have the same UUID then we will consider them as one and the same |
105 | Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount)); | 105 | Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount)); |
@@ -126,19 +126,19 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
126 | UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001"); | 126 | UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001"); |
127 | 127 | ||
128 | SceneObjectPart part1 | 128 | SceneObjectPart part1 |
129 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 129 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
130 | { Name = obj1Name, UUID = objUuid }; | 130 | { Name = obj1Name, UUID = objUuid }; |
131 | 131 | ||
132 | Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True); | 132 | Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True); |
133 | 133 | ||
134 | SceneObjectPart part2 | 134 | SceneObjectPart part2 |
135 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 135 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
136 | { Name = obj2Name, UUID = objUuid }; | 136 | { Name = obj2Name, UUID = objUuid }; |
137 | 137 | ||
138 | Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part2), false), Is.False); | 138 | Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part2), false), Is.False); |
139 | 139 | ||
140 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid); | 140 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid); |
141 | 141 | ||
142 | //m_log.Debug("retrievedPart : {0}", retrievedPart); | 142 | //m_log.Debug("retrievedPart : {0}", retrievedPart); |
143 | // If the parts have the same UUID then we will consider them as one and the same | 143 | // If the parts have the same UUID then we will consider them as one and the same |
144 | Assert.That(retrievedPart.Name, Is.EqualTo(obj1Name)); | 144 | Assert.That(retrievedPart.Name, Is.EqualTo(obj1Name)); |
@@ -171,13 +171,16 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
171 | // Test that we don't get back an object for a local id that doesn't exist | 171 | // Test that we don't get back an object for a local id that doesn't exist |
172 | Assert.That(scene.GetGroupByPrim(999), Is.Null); | 172 | Assert.That(scene.GetGroupByPrim(999), Is.Null); |
173 | 173 | ||
174 | uint soid = so.LocalId; | ||
175 | uint spid = parts[partsToTestCount - 1].LocalId; | ||
176 | |||
174 | // Now delete the scene object and check again | 177 | // Now delete the scene object and check again |
175 | scene.DeleteSceneObject(so, false); | 178 | scene.DeleteSceneObject(so, false); |
176 | 179 | ||
177 | Assert.That(scene.GetGroupByPrim(so.LocalId), Is.Null); | 180 | Assert.That(scene.GetGroupByPrim(soid), Is.Null); |
178 | Assert.That(scene.GetGroupByPrim(parts[partsToTestCount - 1].LocalId), Is.Null); | 181 | Assert.That(scene.GetGroupByPrim(spid), Is.Null); |
179 | } | 182 | } |
180 | 183 | ||
181 | /// <summary> | 184 | /// <summary> |
182 | /// Test deleting an object from a scene. | 185 | /// Test deleting an object from a scene. |
183 | /// </summary> | 186 | /// </summary> |
@@ -194,18 +197,18 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
194 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene); | 197 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene); |
195 | 198 | ||
196 | Assert.That(so.IsDeleted, Is.False); | 199 | Assert.That(so.IsDeleted, Is.False); |
200 | uint retrievedPartID = so.LocalId; | ||
197 | 201 | ||
198 | scene.DeleteSceneObject(so, false); | 202 | scene.DeleteSceneObject(so, false); |
199 | 203 | ||
200 | Assert.That(so.IsDeleted, Is.True); | 204 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(retrievedPartID); |
201 | 205 | ||
202 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); | ||
203 | Assert.That(retrievedPart, Is.Null); | 206 | Assert.That(retrievedPart, Is.Null); |
204 | } | 207 | } |
205 | 208 | ||
206 | /// <summary> | 209 | /// <summary> |
207 | /// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not | 210 | /// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not |
208 | /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by | 211 | /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by |
209 | /// OpenSim. | 212 | /// OpenSim. |
210 | /// </summary> | 213 | /// </summary> |
211 | [Test] | 214 | [Test] |
@@ -215,24 +218,24 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
215 | UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); | 218 | UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); |
216 | string childPartName = "childPart"; | 219 | string childPartName = "childPart"; |
217 | UUID childPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); | 220 | UUID childPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); |
218 | 221 | ||
219 | SceneObjectPart rootPart | 222 | SceneObjectPart rootPart |
220 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 223 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
221 | { Name = rootPartName, UUID = rootPartUuid }; | 224 | { Name = rootPartName, UUID = rootPartUuid }; |
222 | SceneObjectPart linkPart | 225 | SceneObjectPart linkPart |
223 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 226 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
224 | { Name = childPartName, UUID = childPartUuid }; | 227 | { Name = childPartName, UUID = childPartUuid }; |
225 | 228 | ||
226 | SceneObjectGroup sog = new SceneObjectGroup(rootPart); | 229 | SceneObjectGroup sog = new SceneObjectGroup(rootPart); |
227 | sog.AddPart(linkPart); | 230 | sog.AddPart(linkPart); |
228 | 231 | ||
229 | Assert.That(sog.UUID, Is.EqualTo(rootPartUuid)); | 232 | Assert.That(sog.UUID, Is.EqualTo(rootPartUuid)); |
230 | Assert.That(sog.RootPart.UUID, Is.EqualTo(rootPartUuid)); | 233 | Assert.That(sog.RootPart.UUID, Is.EqualTo(rootPartUuid)); |
231 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); | 234 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); |
232 | 235 | ||
233 | UUID newRootPartUuid = new UUID("00000000-0000-0000-0000-000000000002"); | 236 | UUID newRootPartUuid = new UUID("00000000-0000-0000-0000-000000000002"); |
234 | sog.UUID = newRootPartUuid; | 237 | sog.UUID = newRootPartUuid; |
235 | 238 | ||
236 | Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid)); | 239 | Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid)); |
237 | Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid)); | 240 | Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid)); |
238 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); | 241 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); |