mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Replace implicit casts from LSLFloat to int and uint which were removed in
r5487. Also put the unit tests back for Bamboo to execute them, let's see how this goes.
This commit is contained in:
@@ -21,7 +21,19 @@
|
||||
|
||||
<touch file="../${projectdir}/bin/startup_commands.txt" />
|
||||
|
||||
<delete dir="../test-results" />
|
||||
<mkdir dir="../test-results" />
|
||||
<nunit2>
|
||||
<formatter type="Xml" usefile="true" extension=".xml" outputdir="../test-results" />
|
||||
<test>
|
||||
<assemblies>
|
||||
<include name="../bin/OpenSim.Framework.Tests.dll" />
|
||||
<include name="../bin/OpenSim.Region.ScriptEngine.Common.Tests.dll" />
|
||||
<include name="../bin/OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests.dll" />
|
||||
<include name="../bin/OpenSim.Region.Environment.dll" />
|
||||
</assemblies>
|
||||
</test>
|
||||
</nunit2>
|
||||
|
||||
<zip zipfile="../${projectdir}.zip">
|
||||
<fileset basedir="${projectdir}/">
|
||||
|
||||
@@ -1422,6 +1422,16 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
#region Operators
|
||||
|
||||
static public implicit operator int(LSLFloat f)
|
||||
{
|
||||
return (int)f.value;
|
||||
}
|
||||
|
||||
static public implicit operator uint(LSLFloat f)
|
||||
{
|
||||
return (uint) Math.Abs(f.value);
|
||||
}
|
||||
|
||||
static public implicit operator Boolean(LSLFloat f)
|
||||
{
|
||||
if (f.value == 0.0)
|
||||
|
||||
@@ -1477,6 +1477,16 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
|
||||
#region Operators
|
||||
|
||||
static public implicit operator int(LSLFloat f)
|
||||
{
|
||||
return (int)f.value;
|
||||
}
|
||||
|
||||
static public implicit operator uint(LSLFloat f)
|
||||
{
|
||||
return (uint) Math.Abs(f.value);
|
||||
}
|
||||
|
||||
static public implicit operator Boolean(LSLFloat f)
|
||||
{
|
||||
if (f.value == 0.0)
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace OpenSim.Region.ScriptEngine.Common.Tests
|
||||
|
||||
foreach (KeyValuePair<double, int> number in numberSet)
|
||||
{
|
||||
testNumber = (int)(new LSL_Types.LSLFloat(number.Key));
|
||||
testNumber = new LSL_Types.LSLFloat(number.Key);
|
||||
Assert.AreEqual(number.Value, testNumber, "Converting double " + number.Key + ", expecting int " + number.Value);
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,7 @@ namespace OpenSim.Region.ScriptEngine.Common.Tests
|
||||
|
||||
foreach (KeyValuePair<double, int> number in numberSet)
|
||||
{
|
||||
testNumber = (uint)(new LSL_Types.LSLFloat(number.Key));
|
||||
testNumber = new LSL_Types.LSLFloat(number.Key);
|
||||
Assert.AreEqual(number.Value, testNumber, "Converting double " + number.Key + ", expecting uint " + number.Value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user