diff options
Diffstat (limited to 'OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLFloat.cs')
-rw-r--r-- | OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLFloat.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLFloat.cs b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLFloat.cs index c021963..272d06c 100644 --- a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLFloat.cs +++ b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLFloat.cs | |||
@@ -396,6 +396,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
396 | } | 396 | } |
397 | 397 | ||
398 | /// <summary> | 398 | /// <summary> |
399 | /// Tests LSLFloat is correctly cast explicitly to float | ||
400 | /// </summary> | ||
401 | [Test] | ||
402 | public void TestExplicitCastLSLFloatToFloat() | ||
403 | { | ||
404 | float testFloat; | ||
405 | float numberAsFloat; | ||
406 | LSL_Types.LSLFloat testLSLFloat; | ||
407 | foreach (double number in m_doubleList) | ||
408 | { | ||
409 | testLSLFloat = new LSL_Types.LSLFloat(number); | ||
410 | numberAsFloat = (float)number; | ||
411 | testFloat = (float)testLSLFloat; | ||
412 | |||
413 | Assert.That((double)testFloat, new DoubleToleranceConstraint((double)numberAsFloat, _lowPrecisionTolerance)); | ||
414 | } | ||
415 | } | ||
416 | |||
417 | |||
418 | /// <summary> | ||
399 | /// Tests the equality (==) operator. | 419 | /// Tests the equality (==) operator. |
400 | /// </summary> | 420 | /// </summary> |
401 | [Test] | 421 | [Test] |