Get all test methods in OpenSim.Region.ScriptEngine.Tests.dll to report that they're running
parent
ba27d8a389
commit
9992974c66
|
@ -29,6 +29,7 @@ using System.Collections.Generic;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using OpenSim.Region.ScriptEngine.Shared.CodeTools;
|
using OpenSim.Region.ScriptEngine.Shared.CodeTools;
|
||||||
|
using OpenSim.Tests.Common;
|
||||||
|
|
||||||
namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
||||||
{
|
{
|
||||||
|
@ -43,6 +44,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDefaultState()
|
public void TestDefaultState()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -63,6 +66,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCustomState()
|
public void TestCustomState()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -93,6 +98,8 @@ state another_state
|
||||||
[Test]
|
[Test]
|
||||||
public void TestEventWithArguments()
|
public void TestEventWithArguments()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
at_rot_target(integer tnum, rotation targetrot, rotation ourrot)
|
at_rot_target(integer tnum, rotation targetrot, rotation ourrot)
|
||||||
|
@ -113,6 +120,8 @@ state another_state
|
||||||
[Test]
|
[Test]
|
||||||
public void TestIntegerDeclaration()
|
public void TestIntegerDeclaration()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
touch_start(integer num_detected)
|
touch_start(integer num_detected)
|
||||||
|
@ -135,6 +144,8 @@ state another_state
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoneIdent()
|
public void TestLoneIdent()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// A lone ident should be removed completely as it's an error in C#
|
// A lone ident should be removed completely as it's an error in C#
|
||||||
// (MONO at least).
|
// (MONO at least).
|
||||||
string input = @"default
|
string input = @"default
|
||||||
|
@ -161,6 +172,8 @@ state another_state
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAssignments()
|
public void TestAssignments()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
touch_start(integer num_detected)
|
touch_start(integer num_detected)
|
||||||
|
@ -187,6 +200,8 @@ state another_state
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAdditionSubtractionOperator()
|
public void TestAdditionSubtractionOperator()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
touch_start(integer num_detected)
|
touch_start(integer num_detected)
|
||||||
|
@ -215,6 +230,8 @@ state another_state
|
||||||
[Test]
|
[Test]
|
||||||
public void TestStrings()
|
public void TestStrings()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
touch_start(integer num_detected)
|
touch_start(integer num_detected)
|
||||||
|
@ -242,6 +259,8 @@ state another_state
|
||||||
[Test]
|
[Test]
|
||||||
public void TestBinaryExpression()
|
public void TestBinaryExpression()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
touch_start(integer num_detected)
|
touch_start(integer num_detected)
|
||||||
|
@ -284,6 +303,8 @@ state another_state
|
||||||
[Test]
|
[Test]
|
||||||
public void TestFloatConstants()
|
public void TestFloatConstants()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
touch_start(integer num_detected)
|
touch_start(integer num_detected)
|
||||||
|
@ -336,6 +357,8 @@ state another_state
|
||||||
[Test]
|
[Test]
|
||||||
public void TestComments()
|
public void TestComments()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// this test tests comments
|
string input = @"// this test tests comments
|
||||||
default
|
default
|
||||||
{
|
{
|
||||||
|
@ -358,6 +381,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestStringsWithEscapedQuotesAndComments()
|
public void TestStringsWithEscapedQuotesAndComments()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// this test tests strings, with escaped quotes and comments in strings
|
string input = @"// this test tests strings, with escaped quotes and comments in strings
|
||||||
default
|
default
|
||||||
{
|
{
|
||||||
|
@ -397,6 +422,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCStyleComments()
|
public void TestCStyleComments()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"/* this test tests comments
|
string input = @"/* this test tests comments
|
||||||
of the C variety
|
of the C variety
|
||||||
*/
|
*/
|
||||||
|
@ -426,6 +453,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGlobalDefinedFunctions()
|
public void TestGlobalDefinedFunctions()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// this test tests custom defined functions
|
string input = @"// this test tests custom defined functions
|
||||||
|
|
||||||
string onefunc()
|
string onefunc()
|
||||||
|
@ -470,6 +499,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGlobalDeclaredVariables()
|
public void TestGlobalDeclaredVariables()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// this test tests custom defined functions and global variables
|
string input = @"// this test tests custom defined functions and global variables
|
||||||
|
|
||||||
string globalString;
|
string globalString;
|
||||||
|
@ -525,6 +556,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMoreAssignments()
|
public void TestMoreAssignments()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// this test tests +=, -=, *=, /=, %=
|
string input = @"// this test tests +=, -=, *=, /=, %=
|
||||||
|
|
||||||
string globalString;
|
string globalString;
|
||||||
|
@ -579,6 +612,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestVectorConstantNotation()
|
public void TestVectorConstantNotation()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
touch_start(integer num_detected)
|
touch_start(integer num_detected)
|
||||||
|
@ -606,6 +641,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestVectorMemberAccess()
|
public void TestVectorMemberAccess()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
touch_start(integer num_detected)
|
touch_start(integer num_detected)
|
||||||
|
@ -632,6 +669,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExpressionInParentheses()
|
public void TestExpressionInParentheses()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
touch_start(integer num_detected)
|
touch_start(integer num_detected)
|
||||||
|
@ -660,6 +699,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestIncrementDecrementOperator()
|
public void TestIncrementDecrementOperator()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// here we'll test the ++ and -- operators
|
string input = @"// here we'll test the ++ and -- operators
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -690,6 +731,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLists()
|
public void TestLists()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// testing lists
|
string input = @"// testing lists
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -718,6 +761,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestIfStatement()
|
public void TestIfStatement()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test if statements
|
string input = @"// let's test if statements
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -822,6 +867,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestIfElseStatement()
|
public void TestIfElseStatement()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test complex logical expressions
|
string input = @"// let's test complex logical expressions
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -928,6 +975,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestWhileLoop()
|
public void TestWhileLoop()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test while loops
|
string input = @"// let's test while loops
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -968,6 +1017,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDoWhileLoop()
|
public void TestDoWhileLoop()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test do-while loops
|
string input = @"// let's test do-while loops
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1012,6 +1063,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestForLoop()
|
public void TestForLoop()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test for loops
|
string input = @"// let's test for loops
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1056,6 +1109,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestFloatsWithTrailingDecimal()
|
public void TestFloatsWithTrailingDecimal()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// a curious feature of LSL that allows floats to be defined with a trailing dot
|
string input = @"// a curious feature of LSL that allows floats to be defined with a trailing dot
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1108,6 +1163,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestUnaryAndBinaryOperators()
|
public void TestUnaryAndBinaryOperators()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test a few more operators
|
string input = @"// let's test a few more operators
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1144,6 +1201,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestTypecasts()
|
public void TestTypecasts()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test typecasts
|
string input = @"// let's test typecasts
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1189,6 +1248,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestStates()
|
public void TestStates()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test states
|
string input = @"// let's test states
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1229,6 +1290,8 @@ state statetwo
|
||||||
[Test]
|
[Test]
|
||||||
public void TestHexIntegerConstants()
|
public void TestHexIntegerConstants()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test hex integers
|
string input = @"// let's test hex integers
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1261,6 +1324,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestJumps()
|
public void TestJumps()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test jumps
|
string input = @"// let's test jumps
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1291,6 +1356,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestImplicitVariableInitialization()
|
public void TestImplicitVariableInitialization()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test implicitly initializing variables
|
string input = @"// let's test implicitly initializing variables
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1334,6 +1401,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMultipleEqualsExpression()
|
public void TestMultipleEqualsExpression()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test x = y = 5 type expressions
|
string input = @"// let's test x = y = 5 type expressions
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1366,6 +1435,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestUnaryExpressionLastInVectorConstant()
|
public void TestUnaryExpressionLastInVectorConstant()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test unary expressions some more
|
string input = @"// let's test unary expressions some more
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1390,6 +1461,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestVectorMemberPlusEquals()
|
public void TestVectorMemberPlusEquals()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"// let's test unary expressions some more
|
string input = @"// let's test unary expressions some more
|
||||||
|
|
||||||
default
|
default
|
||||||
|
@ -1424,6 +1497,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestWhileLoopWithNoBody()
|
public void TestWhileLoopWithNoBody()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -1447,6 +1522,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDoWhileLoopWithNoBody()
|
public void TestDoWhileLoopWithNoBody()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -1472,6 +1549,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestIfWithNoBody()
|
public void TestIfWithNoBody()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -1495,6 +1574,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestIfElseWithNoBody()
|
public void TestIfElseWithNoBody()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -1521,6 +1602,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestForLoopWithNoBody()
|
public void TestForLoopWithNoBody()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -1544,6 +1627,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestForLoopWithNoAssignment()
|
public void TestForLoopWithNoAssignment()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -1569,6 +1654,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestForLoopWithOnlyIdentInAssignment()
|
public void TestForLoopWithOnlyIdentInAssignment()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -1594,6 +1681,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAssignmentInIfWhileDoWhile()
|
public void TestAssignmentInIfWhileDoWhile()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -1631,6 +1720,8 @@ default
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLSLListHack()
|
public void TestLSLListHack()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -1656,6 +1747,8 @@ default
|
||||||
[ExpectedException(typeof(System.Exception))]
|
[ExpectedException(typeof(System.Exception))]
|
||||||
public void TestSyntaxError()
|
public void TestSyntaxError()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -1682,6 +1775,8 @@ default
|
||||||
[ExpectedException(typeof(System.Exception))]
|
[ExpectedException(typeof(System.Exception))]
|
||||||
public void TestSyntaxErrorDeclaringVariableInForLoop()
|
public void TestSyntaxErrorDeclaringVariableInForLoop()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
|
|
@ -31,6 +31,7 @@ using System.Collections.Generic;
|
||||||
using Microsoft.CSharp;
|
using Microsoft.CSharp;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using OpenSim.Region.ScriptEngine.Shared.CodeTools;
|
using OpenSim.Region.ScriptEngine.Shared.CodeTools;
|
||||||
|
using OpenSim.Tests.Common;
|
||||||
|
|
||||||
namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
||||||
{
|
{
|
||||||
|
@ -92,6 +93,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
||||||
//[Test]
|
//[Test]
|
||||||
public void TestUseUndeclaredVariable()
|
public void TestUseUndeclaredVariable()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
m_compilerParameters.OutputAssembly = Path.Combine(m_testDir, Path.GetRandomFileName() + ".dll");
|
m_compilerParameters.OutputAssembly = Path.Combine(m_testDir, Path.GetRandomFileName() + ".dll");
|
||||||
|
|
||||||
string input = @"default
|
string input = @"default
|
||||||
|
@ -124,6 +127,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
||||||
//[Test]
|
//[Test]
|
||||||
public void TestCastAndConcatString()
|
public void TestCastAndConcatString()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
m_compilerParameters.OutputAssembly = Path.Combine(m_testDir, Path.GetRandomFileName() + ".dll");
|
m_compilerParameters.OutputAssembly = Path.Combine(m_testDir, Path.GetRandomFileName() + ".dll");
|
||||||
|
|
||||||
string input = @"string s = "" a string"";
|
string input = @"string s = "" a string"";
|
||||||
|
@ -150,4 +155,4 @@ default
|
||||||
Assert.AreEqual(0, m_compilerResults.Errors.Count);
|
Assert.AreEqual(0, m_compilerResults.Errors.Count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -46,7 +46,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[TestFixture, LongRunning]
|
[TestFixture, LongRunning]
|
||||||
public class LSL_ApiTest
|
public class LSL_ApiTest
|
||||||
{
|
{
|
||||||
|
|
||||||
private const double ANGLE_ACCURACY_IN_RADIANS = 1E-6;
|
private const double ANGLE_ACCURACY_IN_RADIANS = 1E-6;
|
||||||
private const double VECTOR_COMPONENT_ACCURACY = 0.0000005d;
|
private const double VECTOR_COMPONENT_ACCURACY = 0.0000005d;
|
||||||
private const float FLOAT_ACCURACY = 0.00005f;
|
private const float FLOAT_ACCURACY = 0.00005f;
|
||||||
|
@ -55,7 +54,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp()
|
public void SetUp()
|
||||||
{
|
{
|
||||||
|
|
||||||
IConfigSource initConfigSource = new IniConfigSource();
|
IConfigSource initConfigSource = new IniConfigSource();
|
||||||
IConfig config = initConfigSource.AddConfig("XEngine");
|
IConfig config = initConfigSource.AddConfig("XEngine");
|
||||||
config.Set("Enabled", "true");
|
config.Set("Enabled", "true");
|
||||||
|
@ -75,6 +73,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestllAngleBetween()
|
public void TestllAngleBetween()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
CheckllAngleBetween(new Vector3(1, 0, 0), 0, 1, 1);
|
CheckllAngleBetween(new Vector3(1, 0, 0), 0, 1, 1);
|
||||||
CheckllAngleBetween(new Vector3(1, 0, 0), 90, 1, 1);
|
CheckllAngleBetween(new Vector3(1, 0, 0), 90, 1, 1);
|
||||||
CheckllAngleBetween(new Vector3(1, 0, 0), 180, 1, 1);
|
CheckllAngleBetween(new Vector3(1, 0, 0), 180, 1, 1);
|
||||||
|
@ -158,6 +158,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
// llRot2Euler test.
|
// llRot2Euler test.
|
||||||
public void TestllRot2Euler()
|
public void TestllRot2Euler()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// 180, 90 and zero degree rotations.
|
// 180, 90 and zero degree rotations.
|
||||||
CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.0f, 1.0f));
|
CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.0f, 1.0f));
|
||||||
CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.707107f, 0.707107f));
|
CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.707107f, 0.707107f));
|
||||||
|
@ -256,6 +258,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
// llSetPrimitiveParams and llGetPrimitiveParams test.
|
// llSetPrimitiveParams and llGetPrimitiveParams test.
|
||||||
public void TestllSetPrimitiveParams()
|
public void TestllSetPrimitiveParams()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// Create Prim1.
|
// Create Prim1.
|
||||||
Scene scene = SceneHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
string obj1Name = "Prim1";
|
string obj1Name = "Prim1";
|
||||||
|
@ -486,9 +490,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
// llVecNorm test.
|
|
||||||
public void TestllVecNorm()
|
public void TestllVecNorm()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// Check special case for normalizing zero vector.
|
// Check special case for normalizing zero vector.
|
||||||
CheckllVecNorm(new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), new LSL_Types.Vector3(0.0d, 0.0d, 0.0d));
|
CheckllVecNorm(new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), new LSL_Types.Vector3(0.0d, 0.0d, 0.0d));
|
||||||
// Check various vectors.
|
// Check various vectors.
|
||||||
|
|
|
@ -213,6 +213,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestConstructFromInt()
|
public void TestConstructFromInt()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
|
|
||||||
foreach (KeyValuePair<int, double> number in m_intDoubleSet)
|
foreach (KeyValuePair<int, double> number in m_intDoubleSet)
|
||||||
|
@ -228,6 +230,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestConstructFromDouble()
|
public void TestConstructFromDouble()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
|
|
||||||
foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
|
foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
|
||||||
|
@ -243,6 +247,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitCastLSLFloatToInt()
|
public void TestExplicitCastLSLFloatToInt()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
int testNumber;
|
int testNumber;
|
||||||
|
|
||||||
foreach (KeyValuePair<double, int> number in m_doubleIntSet)
|
foreach (KeyValuePair<double, int> number in m_doubleIntSet)
|
||||||
|
@ -258,6 +264,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitCastLSLFloatToUint()
|
public void TestExplicitCastLSLFloatToUint()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
uint testNumber;
|
uint testNumber;
|
||||||
|
|
||||||
foreach (KeyValuePair<double, int> number in m_doubleUintSet)
|
foreach (KeyValuePair<double, int> number in m_doubleUintSet)
|
||||||
|
@ -273,6 +281,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestImplicitCastLSLFloatToBooleanTrue()
|
public void TestImplicitCastLSLFloatToBooleanTrue()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
bool testBool;
|
bool testBool;
|
||||||
|
|
||||||
|
@ -291,6 +301,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestImplicitCastLSLFloatToBooleanFalse()
|
public void TestImplicitCastLSLFloatToBooleanFalse()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat = new LSL_Types.LSLFloat(0.0);
|
LSL_Types.LSLFloat testFloat = new LSL_Types.LSLFloat(0.0);
|
||||||
bool testBool = testFloat;
|
bool testBool = testFloat;
|
||||||
|
|
||||||
|
@ -303,6 +315,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestImplicitCastIntToLSLFloat()
|
public void TestImplicitCastIntToLSLFloat()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
|
|
||||||
foreach (int number in m_intList)
|
foreach (int number in m_intList)
|
||||||
|
@ -318,6 +332,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestImplicitCastLSLIntegerToLSLFloat()
|
public void TestImplicitCastLSLIntegerToLSLFloat()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
|
|
||||||
foreach (int number in m_intList)
|
foreach (int number in m_intList)
|
||||||
|
@ -333,6 +349,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitCastLSLIntegerToLSLFloat()
|
public void TestExplicitCastLSLIntegerToLSLFloat()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
|
|
||||||
foreach (int number in m_intList)
|
foreach (int number in m_intList)
|
||||||
|
@ -348,6 +366,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitCastStringToLSLFloat()
|
public void TestExplicitCastStringToLSLFloat()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
|
|
||||||
foreach (KeyValuePair<string, double> number in m_stringDoubleSet)
|
foreach (KeyValuePair<string, double> number in m_stringDoubleSet)
|
||||||
|
@ -363,6 +383,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitCastLSLStringToLSLFloat()
|
public void TestExplicitCastLSLStringToLSLFloat()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
|
|
||||||
foreach (KeyValuePair<string, double> number in m_stringDoubleSet)
|
foreach (KeyValuePair<string, double> number in m_stringDoubleSet)
|
||||||
|
@ -378,6 +400,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestImplicitCastDoubleToLSLFloat()
|
public void TestImplicitCastDoubleToLSLFloat()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
|
|
||||||
foreach (double number in m_doubleList)
|
foreach (double number in m_doubleList)
|
||||||
|
@ -393,6 +417,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestImplicitCastLSLFloatToDouble()
|
public void TestImplicitCastLSLFloatToDouble()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
double testNumber;
|
double testNumber;
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
|
|
||||||
|
@ -411,26 +437,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitCastLSLFloatToFloat()
|
public void TestExplicitCastLSLFloatToFloat()
|
||||||
{
|
{
|
||||||
float testFloat;
|
TestHelpers.InMethod();
|
||||||
float numberAsFloat;
|
|
||||||
LSL_Types.LSLFloat testLSLFloat;
|
|
||||||
foreach (double number in m_doubleList)
|
|
||||||
{
|
|
||||||
testLSLFloat = new LSL_Types.LSLFloat(number);
|
|
||||||
numberAsFloat = (float)number;
|
|
||||||
testFloat = (float)testLSLFloat;
|
|
||||||
|
|
||||||
Assert.That((double)testFloat, new DoubleToleranceConstraint((double)numberAsFloat, _lowPrecisionTolerance));
|
float testFloat;
|
||||||
}
|
float numberAsFloat;
|
||||||
|
LSL_Types.LSLFloat testLSLFloat;
|
||||||
|
|
||||||
|
foreach (double number in m_doubleList)
|
||||||
|
{
|
||||||
|
testLSLFloat = new LSL_Types.LSLFloat(number);
|
||||||
|
numberAsFloat = (float)number;
|
||||||
|
testFloat = (float)testLSLFloat;
|
||||||
|
|
||||||
|
Assert.That((double)testFloat, new DoubleToleranceConstraint((double)numberAsFloat, _lowPrecisionTolerance));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tests the equality (==) operator.
|
/// Tests the equality (==) operator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestEqualsOperator()
|
public void TestEqualsOperator()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloatA, testFloatB;
|
LSL_Types.LSLFloat testFloatA, testFloatB;
|
||||||
|
|
||||||
foreach (double number in m_doubleList)
|
foreach (double number in m_doubleList)
|
||||||
|
@ -450,6 +480,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestNotEqualOperator()
|
public void TestNotEqualOperator()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloatA, testFloatB;
|
LSL_Types.LSLFloat testFloatA, testFloatB;
|
||||||
|
|
||||||
foreach (double number in m_doubleList)
|
foreach (double number in m_doubleList)
|
||||||
|
@ -469,6 +501,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestIncrementOperator()
|
public void TestIncrementOperator()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
double testNumber;
|
double testNumber;
|
||||||
|
|
||||||
|
@ -493,6 +527,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDecrementOperator()
|
public void TestDecrementOperator()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
double testNumber;
|
double testNumber;
|
||||||
|
|
||||||
|
@ -517,6 +553,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestToString()
|
public void TestToString()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
|
|
||||||
foreach (KeyValuePair<double, string> number in m_doubleStringSet)
|
foreach (KeyValuePair<double, string> number in m_doubleStringSet)
|
||||||
|
@ -532,6 +570,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAddTwoLSLFloats()
|
public void TestAddTwoLSLFloats()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testResult;
|
LSL_Types.LSLFloat testResult;
|
||||||
|
|
||||||
foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
|
foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
|
||||||
|
@ -547,6 +587,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSubtractTwoLSLFloats()
|
public void TestSubtractTwoLSLFloats()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testResult;
|
LSL_Types.LSLFloat testResult;
|
||||||
|
|
||||||
foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
|
foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
|
||||||
|
@ -562,6 +604,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMultiplyTwoLSLFloats()
|
public void TestMultiplyTwoLSLFloats()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testResult;
|
LSL_Types.LSLFloat testResult;
|
||||||
|
|
||||||
foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
|
foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
|
||||||
|
@ -577,6 +621,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDivideTwoLSLFloats()
|
public void TestDivideTwoLSLFloats()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testResult;
|
LSL_Types.LSLFloat testResult;
|
||||||
|
|
||||||
foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
|
foreach (KeyValuePair<double, double> number in m_doubleDoubleSet)
|
||||||
|
@ -595,6 +641,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestImplicitCastBooleanToLSLFloat()
|
public void TestImplicitCastBooleanToLSLFloat()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testFloat;
|
LSL_Types.LSLFloat testFloat;
|
||||||
|
|
||||||
testFloat = (1 == 0);
|
testFloat = (1 == 0);
|
||||||
|
@ -610,4 +658,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
Assert.That(testFloat.value, new DoubleToleranceConstraint(1.0, _lowPrecisionTolerance));
|
Assert.That(testFloat.value, new DoubleToleranceConstraint(1.0, _lowPrecisionTolerance));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -79,6 +79,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitCastLSLFloatToLSLInteger()
|
public void TestExplicitCastLSLFloatToLSLInteger()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLInteger testInteger;
|
LSL_Types.LSLInteger testInteger;
|
||||||
|
|
||||||
foreach (KeyValuePair<double, int> number in m_doubleIntSet)
|
foreach (KeyValuePair<double, int> number in m_doubleIntSet)
|
||||||
|
@ -94,6 +96,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitCastStringToLSLInteger()
|
public void TestExplicitCastStringToLSLInteger()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLInteger testInteger;
|
LSL_Types.LSLInteger testInteger;
|
||||||
|
|
||||||
foreach (KeyValuePair<string, int> number in m_stringIntSet)
|
foreach (KeyValuePair<string, int> number in m_stringIntSet)
|
||||||
|
@ -109,6 +113,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitCastLSLStringToLSLInteger()
|
public void TestExplicitCastLSLStringToLSLInteger()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLInteger testInteger;
|
LSL_Types.LSLInteger testInteger;
|
||||||
|
|
||||||
foreach (KeyValuePair<string, int> number in m_stringIntSet)
|
foreach (KeyValuePair<string, int> number in m_stringIntSet)
|
||||||
|
@ -124,6 +130,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestImplicitCastBooleanToLSLInteger()
|
public void TestImplicitCastBooleanToLSLInteger()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLInteger testInteger;
|
LSL_Types.LSLInteger testInteger;
|
||||||
|
|
||||||
testInteger = (1 == 0);
|
testInteger = (1 == 0);
|
||||||
|
|
|
@ -71,6 +71,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestConstructFromLSLFloat()
|
public void TestConstructFromLSLFloat()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLString testString;
|
LSL_Types.LSLString testString;
|
||||||
|
|
||||||
foreach (KeyValuePair<double, string> number in m_doubleStringSet)
|
foreach (KeyValuePair<double, string> number in m_doubleStringSet)
|
||||||
|
@ -86,6 +88,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitCastLSLFloatToLSLString()
|
public void TestExplicitCastLSLFloatToLSLString()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLString testString;
|
LSL_Types.LSLString testString;
|
||||||
|
|
||||||
foreach (KeyValuePair<double, string> number in m_doubleStringSet)
|
foreach (KeyValuePair<double, string> number in m_doubleStringSet)
|
||||||
|
@ -101,6 +105,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitCastLSLStringToQuaternion()
|
public void TestExplicitCastLSLStringToQuaternion()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string quaternionString = "<0.00000, 0.70711, 0.00000, 0.70711>";
|
string quaternionString = "<0.00000, 0.70711, 0.00000, 0.70711>";
|
||||||
LSL_Types.LSLString quaternionLSLString = new LSL_Types.LSLString(quaternionString);
|
LSL_Types.LSLString quaternionLSLString = new LSL_Types.LSLString(quaternionString);
|
||||||
|
|
||||||
|
@ -118,6 +124,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestImplicitCastBooleanToLSLFloat()
|
public void TestImplicitCastBooleanToLSLFloat()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLString testString;
|
LSL_Types.LSLString testString;
|
||||||
|
|
||||||
testString = (LSL_Types.LSLString) (1 == 0);
|
testString = (LSL_Types.LSLString) (1 == 0);
|
||||||
|
|
|
@ -44,6 +44,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestConcatenateString()
|
public void TestConcatenateString()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test"));
|
LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test"));
|
||||||
testList += new LSL_Types.LSLString("addition");
|
testList += new LSL_Types.LSLString("addition");
|
||||||
|
|
||||||
|
@ -64,6 +66,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestConcatenateInteger()
|
public void TestConcatenateInteger()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test"));
|
LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test"));
|
||||||
testList += new LSL_Types.LSLInteger(20);
|
testList += new LSL_Types.LSLInteger(20);
|
||||||
|
|
||||||
|
@ -84,6 +88,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestConcatenateDouble()
|
public void TestConcatenateDouble()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test"));
|
LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test"));
|
||||||
testList += new LSL_Types.LSLFloat(2.0f);
|
testList += new LSL_Types.LSLFloat(2.0f);
|
||||||
|
|
||||||
|
@ -104,6 +110,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCastLSLIntegerItemToLSLInteger()
|
public void TestCastLSLIntegerItemToLSLInteger()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(123);
|
LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(123);
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
|
||||||
|
@ -116,6 +124,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCastLSLFloatItemToLSLFloat()
|
public void TestCastLSLFloatItemToLSLFloat()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testValue = new LSL_Types.LSLFloat(123.45678987);
|
LSL_Types.LSLFloat testValue = new LSL_Types.LSLFloat(123.45678987);
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
|
||||||
|
@ -128,6 +138,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCastLSLStringItemToLSLString()
|
public void TestCastLSLStringItemToLSLString()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLString testValue = new LSL_Types.LSLString("hello there");
|
LSL_Types.LSLString testValue = new LSL_Types.LSLString("hello there");
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
|
||||||
|
@ -140,6 +152,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCastVector3ItemToVector3()
|
public void TestCastVector3ItemToVector3()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.Vector3 testValue = new LSL_Types.Vector3(12.34, 56.987654, 0.00987);
|
LSL_Types.Vector3 testValue = new LSL_Types.Vector3(12.34, 56.987654, 0.00987);
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
|
||||||
|
@ -151,6 +165,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCastQuaternionItemToQuaternion()
|
public void TestCastQuaternionItemToQuaternion()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.Quaternion testValue = new LSL_Types.Quaternion(12.34, 56.44323, 765.983421, 0.00987);
|
LSL_Types.Quaternion testValue = new LSL_Types.Quaternion(12.34, 56.44323, 765.983421, 0.00987);
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
|
||||||
|
@ -165,6 +181,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGetLSLIntegerItemForLSLIntegerItem()
|
public void TestGetLSLIntegerItemForLSLIntegerItem()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(999911);
|
LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(999911);
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
|
||||||
|
@ -177,6 +195,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGetLSLFloatItemForLSLFloatItem()
|
public void TestGetLSLFloatItemForLSLFloatItem()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLFloat testValue = new LSL_Types.LSLFloat(321.45687876);
|
LSL_Types.LSLFloat testValue = new LSL_Types.LSLFloat(321.45687876);
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
|
||||||
|
@ -189,11 +209,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGetLSLFloatItemForLSLIntegerItem()
|
public void TestGetLSLFloatItemForLSLIntegerItem()
|
||||||
{
|
{
|
||||||
LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(3060987);
|
TestHelpers.InMethod();
|
||||||
LSL_Types.LSLFloat testFloatValue = new LSL_Types.LSLFloat(testValue);
|
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
|
||||||
|
|
||||||
Assert.AreEqual(testFloatValue, testList.GetLSLFloatItem(0));
|
LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(3060987);
|
||||||
|
LSL_Types.LSLFloat testFloatValue = new LSL_Types.LSLFloat(testValue);
|
||||||
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
|
||||||
|
Assert.AreEqual(testFloatValue, testList.GetLSLFloatItem(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -202,6 +224,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGetLSLStringItemForLSLStringItem()
|
public void TestGetLSLStringItemForLSLStringItem()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.LSLString testValue = new LSL_Types.LSLString("hello all");
|
LSL_Types.LSLString testValue = new LSL_Types.LSLString("hello all");
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
|
||||||
|
@ -214,6 +238,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGetLSLStringItemForKeyItem()
|
public void TestGetLSLStringItemForKeyItem()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.key testValue
|
LSL_Types.key testValue
|
||||||
= new LSL_Types.key("98000000-0000-2222-3333-100000001000");
|
= new LSL_Types.key("98000000-0000-2222-3333-100000001000");
|
||||||
LSL_Types.LSLString testStringValue = new LSL_Types.LSLString(testValue);
|
LSL_Types.LSLString testStringValue = new LSL_Types.LSLString(testValue);
|
||||||
|
@ -228,6 +254,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGetVector3ItemForVector3Item()
|
public void TestGetVector3ItemForVector3Item()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.Vector3 testValue = new LSL_Types.Vector3(92.34, 58.98754, -0.10987);
|
LSL_Types.Vector3 testValue = new LSL_Types.Vector3(92.34, 58.98754, -0.10987);
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
|
||||||
|
@ -239,6 +267,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGetQuaternionItemForQuaternionItem()
|
public void TestGetQuaternionItemForQuaternionItem()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.Quaternion testValue = new LSL_Types.Quaternion(12.64, 59.43723, 765.3421, 4.00987);
|
LSL_Types.Quaternion testValue = new LSL_Types.Quaternion(12.64, 59.43723, 765.3421, 4.00987);
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
|
||||||
|
@ -251,6 +281,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGetKeyItemForKeyItem()
|
public void TestGetKeyItemForKeyItem()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
LSL_Types.key testValue
|
LSL_Types.key testValue
|
||||||
= new LSL_Types.key("00000000-0000-2222-3333-100000001012");
|
= new LSL_Types.key("00000000-0000-2222-3333-100000001012");
|
||||||
LSL_Types.list testList = new LSL_Types.list(testValue);
|
LSL_Types.list testList = new LSL_Types.list(testValue);
|
||||||
|
@ -258,4 +290,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
Assert.AreEqual(testValue, testList.GetKeyItem(0));
|
Assert.AreEqual(testValue, testList.GetKeyItem(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -32,16 +32,17 @@ using OpenSim.Region.ScriptEngine.Shared;
|
||||||
|
|
||||||
namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Tests for Vector3
|
||||||
|
/// </summary>
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class LSL_TypesTestVector3
|
public class LSL_TypesTestVector3
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Tests for Vector3
|
|
||||||
/// </summary>
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
||||||
public void TestDotProduct()
|
public void TestDotProduct()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// The numbers we test for.
|
// The numbers we test for.
|
||||||
Dictionary<string, double> expectsSet = new Dictionary<string, double>();
|
Dictionary<string, double> expectsSet = new Dictionary<string, double>();
|
||||||
expectsSet.Add("<1, 2, 3> * <2, 3, 4>", 20.0);
|
expectsSet.Add("<1, 2, 3> * <2, 3, 4>", 20.0);
|
||||||
|
|
Loading…
Reference in New Issue