From 85fc2dfe3c9c8fc1881833385d13e1c6aae13fe9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 10 Aug 2010 16:16:57 +0100 Subject: extend TestDuplicateObject() to a two prim object --- .../Framework/Scenes/Tests/SceneGraphTests.cs | 29 ++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index 8a103d7..bb6e540 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs @@ -48,22 +48,31 @@ namespace OpenSim.Region.Framework.Scenes.Tests TestHelper.InMethod(); Scene scene = SceneSetupHelpers.SetupScene(); - UUID ownerUuid = new UUID("00000000-0000-0000-0000-000000000010"); - string objName = "obj1"; - UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001"); + UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010"); + string part1Name = "part1"; + UUID part1Id = new UUID("00000000-0000-0000-0000-000000000001"); + string part2Name = "part2"; + UUID part2Id = new UUID("00000000-0000-0000-0000-000000000002"); - SceneObjectPart part - = new SceneObjectPart(ownerUuid, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) - { Name = objName, UUID = objUuid }; + SceneObjectPart part1 + = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = part1Name, UUID = part1Id }; + SceneObjectGroup so = new SceneObjectGroup(part1); + SceneObjectPart part2 + = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = part2Name, UUID = part2Id }; + so.AddPart(part2); - scene.AddNewSceneObject(new SceneObjectGroup(part), false); + scene.AddNewSceneObject(so, false); + + uint part1LocalId = part1.LocalId; SceneObjectGroup duplicatedSo = scene.SceneGraph.DuplicateObject( - part.LocalId, new Vector3(10, 0, 0), 0, ownerUuid, UUID.Zero, Quaternion.Identity); + part1LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity); - Assert.That(duplicatedSo.Children.Count, Is.EqualTo(1)); - Assert.That(duplicatedSo.RootPart.LocalId, Is.Not.EqualTo(part.LocalId)); + Assert.That(duplicatedSo.Children.Count, Is.EqualTo(2)); + Assert.That(duplicatedSo.RootPart.LocalId, Is.Not.EqualTo(part1.LocalId)); //SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid); } -- cgit v1.1