From e60cf0e67d7f34c5d2a45d98c400b9cdea58752a Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Fri, 25 Jul 2008 04:47:11 +0000 Subject: -add test for newly introduced cast operators (issue 1818) -fix formatting -remove CompilerTest test since it seems to fail randomly --- .../Region/ScriptEngine/Common/LSL_TypesTestLSLFloat.cs | 15 +++++++++++++++ .../Region/ScriptEngine/Shared/CodeTools/CompilerTest.cs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Common/LSL_TypesTestLSLFloat.cs b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Common/LSL_TypesTestLSLFloat.cs index 00bf4f4..aba87ac 100644 --- a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Common/LSL_TypesTestLSLFloat.cs +++ b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Common/LSL_TypesTestLSLFloat.cs @@ -319,6 +319,21 @@ namespace OpenSim.Region.ScriptEngine.Common.Tests } /// + /// Tests string is correctly cast implicitly to LSLFloat. + /// + [Test] + public void TestExplicitCastLSLStringToLSLFloat() + { + LSL_Types.LSLFloat testFloat; + + foreach (KeyValuePair number in m_stringDoubleSet) + { + testFloat = (LSL_Types.LSLFloat) new LSL_Types.LSLString(number.Key); + Assert.That(testFloat.value, new DoubleToleranceConstraint(number.Value, _lowPrecisionTolerance)); + } + } + + /// /// Tests double is correctly cast implicitly to LSLFloat. /// [Test] diff --git a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/CompilerTest.cs b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/CompilerTest.cs index 7a11d33..43e3143 100644 --- a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/CompilerTest.cs +++ b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/CompilerTest.cs @@ -85,7 +85,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests } } - [Test] + //[Test] /// /// Test the C# compiler error message can be mapped to the correct /// line/column in the LSL source when an undeclared variable is used. -- cgit v1.1