diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Framework/Tests/UtilTest.cs | |
parent | Add a build script. (diff) | |
download | opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Framework/Tests/UtilTest.cs')
-rw-r--r-- | OpenSim/Framework/Tests/UtilTest.cs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs index cfe3139..b3d79ee 100644 --- a/OpenSim/Framework/Tests/UtilTest.cs +++ b/OpenSim/Framework/Tests/UtilTest.cs | |||
@@ -59,12 +59,12 @@ namespace OpenSim.Framework.Tests | |||
59 | Assert.That(Util.GetMagnitude(v2), | 59 | Assert.That(Util.GetMagnitude(v2), |
60 | new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance), | 60 | new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance), |
61 | "Magnitude of vector was incorrect."); | 61 | "Magnitude of vector was incorrect."); |
62 | 62 | /* | |
63 | TestDelegate d = delegate() { Util.GetNormalizedVector(v1); }; | 63 | TestDelegate d = delegate() { Util.GetNormalizedVector(v1); }; |
64 | bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); | 64 | bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); |
65 | Assert.That(causesArgumentException, Is.True, | 65 | Assert.That(causesArgumentException, Is.True, |
66 | "Getting magnitude of null vector did not cause argument exception."); | 66 | "Getting magnitude of null vector did not cause argument exception."); |
67 | 67 | */ | |
68 | Vector3 expectedNormalizedVector = new Vector3(.577f, .577f, .577f); | 68 | Vector3 expectedNormalizedVector = new Vector3(.577f, .577f, .577f); |
69 | double expectedNormalizedMagnitude = 1; | 69 | double expectedNormalizedMagnitude = 1; |
70 | Vector3 normalizedVector = Util.GetNormalizedVector(v2); | 70 | Vector3 normalizedVector = Util.GetNormalizedVector(v2); |
@@ -92,7 +92,7 @@ namespace OpenSim.Framework.Tests | |||
92 | Assert.That(Util.GetMagnitude(v2), | 92 | Assert.That(Util.GetMagnitude(v2), |
93 | new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance), | 93 | new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance), |
94 | "Magnitude of vector was incorrect."); | 94 | "Magnitude of vector was incorrect."); |
95 | 95 | /* | |
96 | TestDelegate d = delegate() { Util.GetNormalizedVector(v1); }; | 96 | TestDelegate d = delegate() { Util.GetNormalizedVector(v1); }; |
97 | bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); | 97 | bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); |
98 | Assert.That(causesArgumentException, Is.True, | 98 | Assert.That(causesArgumentException, Is.True, |
@@ -102,6 +102,7 @@ namespace OpenSim.Framework.Tests | |||
102 | causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); | 102 | causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); |
103 | Assert.That(causesArgumentException, Is.True, | 103 | Assert.That(causesArgumentException, Is.True, |
104 | "Getting magnitude of null vector did not cause argument exception."); | 104 | "Getting magnitude of null vector did not cause argument exception."); |
105 | */ | ||
105 | } | 106 | } |
106 | 107 | ||
107 | //Lets test a simple case of <0,0,0> and <-5,-5,-5> | 108 | //Lets test a simple case of <0,0,0> and <-5,-5,-5> |
@@ -120,12 +121,12 @@ namespace OpenSim.Framework.Tests | |||
120 | Assert.That(Util.GetMagnitude(v2), | 121 | Assert.That(Util.GetMagnitude(v2), |
121 | new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance), | 122 | new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance), |
122 | "Magnitude of vector was incorrect."); | 123 | "Magnitude of vector was incorrect."); |
123 | 124 | /* | |
124 | TestDelegate d = delegate() { Util.GetNormalizedVector(v1); }; | 125 | TestDelegate d = delegate() { Util.GetNormalizedVector(v1); }; |
125 | bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); | 126 | bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); |
126 | Assert.That(causesArgumentException, Is.True, | 127 | Assert.That(causesArgumentException, Is.True, |
127 | "Getting magnitude of null vector did not cause argument exception."); | 128 | "Getting magnitude of null vector did not cause argument exception."); |
128 | 129 | */ | |
129 | Vector3 expectedNormalizedVector = new Vector3(-.577f, -.577f, -.577f); | 130 | Vector3 expectedNormalizedVector = new Vector3(-.577f, -.577f, -.577f); |
130 | double expectedNormalizedMagnitude = 1; | 131 | double expectedNormalizedMagnitude = 1; |
131 | Vector3 normalizedVector = Util.GetNormalizedVector(v2); | 132 | Vector3 normalizedVector = Util.GetNormalizedVector(v2); |
@@ -232,7 +233,7 @@ namespace OpenSim.Framework.Tests | |||
232 | "application/vnd.ll.clothing", | 233 | "application/vnd.ll.clothing", |
233 | "application/vnd.ll.gesture" | 234 | "application/vnd.ll.gesture" |
234 | }; | 235 | }; |
235 | 236 | ||
236 | for (int i=0;i<inventorytypes.Length;i++) | 237 | for (int i=0;i<inventorytypes.Length;i++) |
237 | { | 238 | { |
238 | Assert.AreEqual(invcontenttypes[i], SLUtil.SLInvTypeToContentType(inventorytypes[i]), | 239 | Assert.AreEqual(invcontenttypes[i], SLUtil.SLInvTypeToContentType(inventorytypes[i]), |