Add very basic test for resizing a scene object with one prim

bulletsim
Justin Clark-Casey (justincc) 2011-07-16 02:44:00 +01:00
parent 6179879308
commit 50bd48542c
2 changed files with 69 additions and 1 deletions

View File

@ -617,9 +617,10 @@ namespace OpenSim.Region.Framework.Scenes
finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X; finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X;
finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y; finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y;
finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z; finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z;
return finalScale;
return finalScale;
} }
public EntityIntersection TestIntersection(Ray hRay, bool frontFacesOnly, bool faceCenters) public EntityIntersection TestIntersection(Ray hRay, bool frontFacesOnly, bool faceCenters)
{ {
// We got a request from the inner_scene to raytrace along the Ray hRay // We got a request from the inner_scene to raytrace along the Ray hRay

View File

@ -0,0 +1,67 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Reflection;
using NUnit.Framework;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
namespace OpenSim.Region.Framework.Scenes.Tests
{
/// <summary>
/// Basic scene object resize tests
/// </summary>
[TestFixture]
public class SceneObjectResizeTests
{
/// <summary>
/// Test resizing an object
/// </summary>
[Test]
public void TestResizeSceneObject()
{
TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene();
SceneObjectGroup g1 = SceneSetupHelpers.AddSceneObject(scene).ParentGroup;
g1.GroupResize(new Vector3(2, 3, 4), g1.LocalId);
SceneObjectGroup g1Post = scene.GetSceneObjectGroup(g1.UUID);
Assert.That(g1Post.RootPart.Scale.X, Is.EqualTo(2));
Assert.That(g1Post.RootPart.Scale.Y, Is.EqualTo(3));
Assert.That(g1Post.RootPart.Scale.Z, Is.EqualTo(4));
}
}
}