Add VectorRenderModuleTests.TestRepeatDraw()
parent
30c36a3960
commit
b97f58d597
|
@ -45,31 +45,68 @@ using OpenSim.Tests.Common.Mock;
|
||||||
namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests
|
namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class VectorRenderModuleTests
|
public class VectorRenderModuleTests : OpenSimTestCase
|
||||||
{
|
{
|
||||||
|
Scene m_scene;
|
||||||
|
DynamicTextureModule m_dtm;
|
||||||
|
VectorRenderModule m_vrm;
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void SetUp()
|
||||||
|
{
|
||||||
|
m_scene = new SceneHelpers().SetupScene();
|
||||||
|
m_dtm = new DynamicTextureModule();
|
||||||
|
m_vrm = new VectorRenderModule();
|
||||||
|
SceneHelpers.SetupSceneModules(m_scene, m_dtm, m_vrm);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDraw()
|
public void TestDraw()
|
||||||
{
|
{
|
||||||
TestHelpers.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
Scene scene = new SceneHelpers().SetupScene();
|
SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene);
|
||||||
DynamicTextureModule dtm = new DynamicTextureModule();
|
|
||||||
VectorRenderModule vrm = new VectorRenderModule();
|
|
||||||
SceneHelpers.SetupSceneModules(scene, dtm, vrm);
|
|
||||||
|
|
||||||
SceneObjectGroup so = SceneHelpers.AddSceneObject(scene);
|
|
||||||
UUID originalTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID;
|
UUID originalTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID;
|
||||||
|
|
||||||
dtm.AddDynamicTextureData(
|
m_dtm.AddDynamicTextureData(
|
||||||
scene.RegionInfo.RegionID,
|
m_scene.RegionInfo.RegionID,
|
||||||
so.UUID,
|
so.UUID,
|
||||||
vrm.GetContentType(),
|
m_vrm.GetContentType(),
|
||||||
"PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World;",
|
"PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World;",
|
||||||
"",
|
"",
|
||||||
0);
|
0);
|
||||||
|
|
||||||
|
|
||||||
Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID));
|
Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestRepeatDraw()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
|
string dtText = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World;";
|
||||||
|
|
||||||
|
SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene);
|
||||||
|
|
||||||
|
m_dtm.AddDynamicTextureData(
|
||||||
|
m_scene.RegionInfo.RegionID,
|
||||||
|
so.UUID,
|
||||||
|
m_vrm.GetContentType(),
|
||||||
|
dtText,
|
||||||
|
"",
|
||||||
|
0);
|
||||||
|
|
||||||
|
UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID;
|
||||||
|
|
||||||
|
m_dtm.AddDynamicTextureData(
|
||||||
|
m_scene.RegionInfo.RegionID,
|
||||||
|
so.UUID,
|
||||||
|
m_vrm.GetContentType(),
|
||||||
|
dtText,
|
||||||
|
"",
|
||||||
|
0);
|
||||||
|
|
||||||
|
Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue