improve TestAddSceneObject() to test a multi-part object rather than a single-part
parent
306af9934a
commit
88bd71b978
|
@ -52,22 +52,25 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
TestHelpers.InMethod();
|
||||
|
||||
Scene scene = SceneHelpers.SetupScene();
|
||||
int partsToTestCount = 3;
|
||||
|
||||
string objName = "obj1";
|
||||
UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
|
||||
SceneObjectGroup so
|
||||
= SceneHelpers.CreateSceneObject(partsToTestCount, TestHelpers.ParseTail(0x1), "obj1", 0x10);
|
||||
SceneObjectPart[] parts = so.Parts;
|
||||
|
||||
SceneObjectPart part
|
||||
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
|
||||
{ Name = objName, UUID = objUuid };
|
||||
|
||||
Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part), false), Is.True);
|
||||
|
||||
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid);
|
||||
Assert.That(scene.AddNewSceneObject(so, false), Is.True);
|
||||
SceneObjectGroup retrievedSo = scene.GetSceneObjectGroup(so.UUID);
|
||||
SceneObjectPart[] retrievedParts = retrievedSo.Parts;
|
||||
|
||||
//m_log.Debug("retrievedPart : {0}", retrievedPart);
|
||||
// If the parts have the same UUID then we will consider them as one and the same
|
||||
Assert.That(retrievedPart.Name, Is.EqualTo(objName));
|
||||
Assert.That(retrievedPart.UUID, Is.EqualTo(objUuid));
|
||||
Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount));
|
||||
|
||||
for (int i = 0; i < partsToTestCount; i++)
|
||||
{
|
||||
Assert.That(retrievedParts[i].Name, Is.EqualTo(parts[i].Name));
|
||||
Assert.That(retrievedParts[i].UUID, Is.EqualTo(parts[i].UUID));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
Loading…
Reference in New Issue