work around some 'tests' error: normalization of <0,0,0> no longer causes argument exception, missed a few more

LSLKeyTest
UbitUmarov 2015-11-16 19:00:53 +00:00
parent fd2784a037
commit 95a7a03052
1 changed files with 4 additions and 3 deletions

View File

@ -92,7 +92,7 @@ namespace OpenSim.Framework.Tests
Assert.That(Util.GetMagnitude(v2), Assert.That(Util.GetMagnitude(v2),
new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance), new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance),
"Magnitude of vector was incorrect."); "Magnitude of vector was incorrect.");
/*
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); }; TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
Assert.That(causesArgumentException, Is.True, Assert.That(causesArgumentException, Is.True,
@ -102,6 +102,7 @@ namespace OpenSim.Framework.Tests
causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
Assert.That(causesArgumentException, Is.True, Assert.That(causesArgumentException, Is.True,
"Getting magnitude of null vector did not cause argument exception."); "Getting magnitude of null vector did not cause argument exception.");
*/
} }
//Lets test a simple case of <0,0,0> and <-5,-5,-5> //Lets test a simple case of <0,0,0> and <-5,-5,-5>
@ -120,12 +121,12 @@ namespace OpenSim.Framework.Tests
Assert.That(Util.GetMagnitude(v2), Assert.That(Util.GetMagnitude(v2),
new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance), new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance),
"Magnitude of vector was incorrect."); "Magnitude of vector was incorrect.");
/*
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); }; TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
Assert.That(causesArgumentException, Is.True, Assert.That(causesArgumentException, Is.True,
"Getting magnitude of null vector did not cause argument exception."); "Getting magnitude of null vector did not cause argument exception.");
*/
Vector3 expectedNormalizedVector = new Vector3(-.577f, -.577f, -.577f); Vector3 expectedNormalizedVector = new Vector3(-.577f, -.577f, -.577f);
double expectedNormalizedMagnitude = 1; double expectedNormalizedMagnitude = 1;
Vector3 normalizedVector = Util.GetNormalizedVector(v2); Vector3 normalizedVector = Util.GetNormalizedVector(v2);