2006-11-13 10:36:43 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using libsecondlife;
|
|
|
|
|
using libsecondlife.Packets;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace libsecondlife.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class PrimObjectTests : Assert
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void PathBegin()
|
|
|
|
|
{
|
|
|
|
|
for (byte i = 0; i < byte.MaxValue; i++)
|
|
|
|
|
{
|
2007-01-31 13:46:16 +00:00
|
|
|
float floatValue = LLObject.PathBeginFloat(i);
|
|
|
|
|
byte result = LLObject.PathBeginByte(floatValue);
|
2006-11-13 10:36:43 +00:00
|
|
|
|
|
|
|
|
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
|
|
|
|
|
", and ended up with " + result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void PathEnd()
|
|
|
|
|
{
|
|
|
|
|
for (byte i = 0; i < byte.MaxValue; i++)
|
|
|
|
|
{
|
2007-01-31 13:46:16 +00:00
|
|
|
float floatValue = LLObject.PathEndFloat(i);
|
|
|
|
|
byte result = LLObject.PathEndByte(floatValue);
|
2006-11-13 10:36:43 +00:00
|
|
|
|
|
|
|
|
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
|
|
|
|
|
", and ended up with " + result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void PathRadiusOffset()
|
|
|
|
|
{
|
|
|
|
|
for (sbyte i = sbyte.MinValue; i < sbyte.MaxValue; i++)
|
|
|
|
|
{
|
2007-01-31 13:46:16 +00:00
|
|
|
float floatValue = LLObject.PathRadiusOffsetFloat(i);
|
|
|
|
|
sbyte result = LLObject.PathRadiusOffsetByte(floatValue);
|
2006-11-13 10:36:43 +00:00
|
|
|
|
|
|
|
|
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
|
|
|
|
|
", and ended up with " + result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void PathRevolutions()
|
|
|
|
|
{
|
|
|
|
|
for (byte i = 0; i < byte.MaxValue; i++)
|
|
|
|
|
{
|
2007-01-31 13:46:16 +00:00
|
|
|
float floatValue = LLObject.PathRevolutionsFloat(i);
|
|
|
|
|
byte result = LLObject.PathRevolutionsByte(floatValue);
|
2006-11-13 10:36:43 +00:00
|
|
|
|
|
|
|
|
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
|
|
|
|
|
", and ended up with " + result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void PathScale()
|
|
|
|
|
{
|
|
|
|
|
for (byte i = 0; i < byte.MaxValue; i++)
|
|
|
|
|
{
|
2007-01-31 13:46:16 +00:00
|
|
|
float floatValue = LLObject.PathScaleFloat(i);
|
|
|
|
|
byte result = LLObject.PathScaleByte(floatValue);
|
2006-11-13 10:36:43 +00:00
|
|
|
|
|
|
|
|
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
|
|
|
|
|
", and ended up with " + result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void PathShear()
|
|
|
|
|
{
|
|
|
|
|
for (byte i = 0; i < byte.MaxValue; i++)
|
|
|
|
|
{
|
2007-01-31 13:46:16 +00:00
|
|
|
float floatValue = LLObject.PathShearFloat(i);
|
|
|
|
|
byte result = LLObject.PathShearByte(floatValue);
|
2006-11-13 10:36:43 +00:00
|
|
|
|
|
|
|
|
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
|
|
|
|
|
", and ended up with " + result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void PathSkew()
|
|
|
|
|
{
|
|
|
|
|
for (sbyte i = sbyte.MinValue; i < sbyte.MaxValue; i++)
|
|
|
|
|
{
|
2007-01-31 13:46:16 +00:00
|
|
|
float floatValue = LLObject.PathSkewFloat(i);
|
|
|
|
|
sbyte result = LLObject.PathSkewByte(floatValue);
|
2006-11-13 10:36:43 +00:00
|
|
|
|
|
|
|
|
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
|
|
|
|
|
", and ended up with " + result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void PathTaper()
|
|
|
|
|
{
|
|
|
|
|
for (sbyte i = sbyte.MinValue; i < sbyte.MaxValue; i++)
|
|
|
|
|
{
|
2007-01-31 13:46:16 +00:00
|
|
|
float floatValue = LLObject.PathTaperFloat(i);
|
|
|
|
|
sbyte result = LLObject.PathTaperByte(floatValue);
|
2006-11-13 10:36:43 +00:00
|
|
|
|
|
|
|
|
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
|
|
|
|
|
", and ended up with " + result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ProfileBegin()
|
|
|
|
|
{
|
|
|
|
|
for (byte i = 0; i < byte.MaxValue; i++)
|
|
|
|
|
{
|
2007-01-31 13:46:16 +00:00
|
|
|
float floatValue = LLObject.ProfileBeginFloat(i);
|
|
|
|
|
byte result = LLObject.ProfileBeginByte(floatValue);
|
2006-11-13 10:36:43 +00:00
|
|
|
|
|
|
|
|
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
|
|
|
|
|
", and ended up with " + result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ProfileEnd()
|
|
|
|
|
{
|
|
|
|
|
for (byte i = 0; i < byte.MaxValue; i++)
|
|
|
|
|
{
|
2007-01-31 13:46:16 +00:00
|
|
|
float floatValue = LLObject.ProfileEndFloat(i);
|
|
|
|
|
byte result = LLObject.ProfileEndByte(floatValue);
|
2006-11-13 10:36:43 +00:00
|
|
|
|
|
|
|
|
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
|
|
|
|
|
", and ended up with " + result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|