aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-05-21 21:46:41 +0100
committerJustin Clark-Casey (justincc)2010-05-21 21:46:41 +0100
commit76135eec5bfcd31357f8e698538747eb72fb8233 (patch)
treef73b636430d9d34c4fb3a86e5d31de9ba946f17f /OpenSim
parentextend TestAddSceneObject() to check Scene.AddNewSceneObject() return boolean (diff)
downloadopensim-SC_OLD-76135eec5bfcd31357f8e698538747eb72fb8233.zip
opensim-SC_OLD-76135eec5bfcd31357f8e698538747eb72fb8233.tar.gz
opensim-SC_OLD-76135eec5bfcd31357f8e698538747eb72fb8233.tar.bz2
opensim-SC_OLD-76135eec5bfcd31357f8e698538747eb72fb8233.tar.xz
add test to make sure that adding an object where one already exists in the scene with that uuid fails
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 4fe4a6a..39f8acf 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -72,6 +72,40 @@ namespace OpenSim.Region.Framework.Scenes.Tests
72 Assert.That(retrievedPart.Name, Is.EqualTo(objName)); 72 Assert.That(retrievedPart.Name, Is.EqualTo(objName));
73 Assert.That(retrievedPart.UUID, Is.EqualTo(objUuid)); 73 Assert.That(retrievedPart.UUID, Is.EqualTo(objUuid));
74 } 74 }
75
76 [Test]
77 /// <summary>
78 /// It shouldn't be possible to add a scene object if one with that uuid already exists in the scene.
79 /// </summary>
80 public void TestAddExistingSceneObjectUuid()
81 {
82 TestHelper.InMethod();
83
84 Scene scene = SceneSetupHelpers.SetupScene();
85
86 string obj1Name = "Alfred";
87 string obj2Name = "Betty";
88 UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
89
90 SceneObjectPart part1
91 = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
92 { Name = obj1Name, UUID = objUuid };
93
94 Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True);
95
96 SceneObjectPart part2
97 = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
98 { Name = obj2Name, UUID = objUuid };
99
100 Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part2), false), Is.False);
101
102 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid);
103
104 //m_log.Debug("retrievedPart : {0}", retrievedPart);
105 // If the parts have the same UUID then we will consider them as one and the same
106 Assert.That(retrievedPart.Name, Is.EqualTo(obj1Name));
107 Assert.That(retrievedPart.UUID, Is.EqualTo(objUuid));
108 }
75 109
76 /// <summary> 110 /// <summary>
77 /// Test deleting an object from a scene. 111 /// Test deleting an object from a scene.