diff options
author | Justin Clark-Casey (justincc) | 2011-09-13 17:52:10 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-09-13 17:52:10 +0100 |
commit | c14f0a22d44c582fb277ba34dec7cee629ba7f4a (patch) | |
tree | 23b6d4db72e7f4b23f2f0533f10bcc2a909000e1 /OpenSim | |
parent | improve TestAddSceneObject() to test a multi-part object rather than a single... (diff) | |
download | opensim-SC-c14f0a22d44c582fb277ba34dec7cee629ba7f4a.zip opensim-SC-c14f0a22d44c582fb277ba34dec7cee629ba7f4a.tar.gz opensim-SC-c14f0a22d44c582fb277ba34dec7cee629ba7f4a.tar.bz2 opensim-SC-c14f0a22d44c582fb277ba34dec7cee629ba7f4a.tar.xz |
Add new TestGetSceneObjectByPartLocalId() for retrieving a scene object via the local id of one of its parts
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 8f2e21f..281b85c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | |||
@@ -106,6 +106,33 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
106 | Assert.That(retrievedPart.Name, Is.EqualTo(obj1Name)); | 106 | Assert.That(retrievedPart.Name, Is.EqualTo(obj1Name)); |
107 | Assert.That(retrievedPart.UUID, Is.EqualTo(objUuid)); | 107 | Assert.That(retrievedPart.UUID, Is.EqualTo(objUuid)); |
108 | } | 108 | } |
109 | |||
110 | /// <summary> | ||
111 | /// Test retrieving a scene object via the local id of one of its parts. | ||
112 | /// </summary> | ||
113 | [Test] | ||
114 | public void TestGetSceneObjectByPartLocalId() | ||
115 | { | ||
116 | TestHelpers.InMethod(); | ||
117 | |||
118 | Scene scene = SceneHelpers.SetupScene(); | ||
119 | int partsToTestCount = 3; | ||
120 | |||
121 | SceneObjectGroup so | ||
122 | = SceneHelpers.CreateSceneObject(partsToTestCount, TestHelpers.ParseTail(0x1), "obj1", 0x10); | ||
123 | SceneObjectPart[] parts = so.Parts; | ||
124 | |||
125 | scene.AddNewSceneObject(so, false); | ||
126 | |||
127 | // Test getting via the root part's local id | ||
128 | Assert.That(scene.GetGroupByPrim(so.LocalId), Is.Not.Null); | ||
129 | |||
130 | // Test getting via a non root part's local id | ||
131 | Assert.That(scene.GetGroupByPrim(parts[partsToTestCount - 1].LocalId), Is.Not.Null); | ||
132 | |||
133 | // Test that we don't get back an object for a local id that doesn't exist | ||
134 | Assert.That(scene.GetGroupByPrim(999), Is.Null); | ||
135 | } | ||
109 | 136 | ||
110 | /// <summary> | 137 | /// <summary> |
111 | /// Test deleting an object from a scene. | 138 | /// Test deleting an object from a scene. |