diff options
author | lbsa71 | 2009-04-01 06:11:51 +0000 |
---|---|---|
committer | lbsa71 | 2009-04-01 06:11:51 +0000 |
commit | 0266c344fb425e1338f988f542fc532e9b47aa1f (patch) | |
tree | 3fc692aa2ee65e20f60a6dfaadb7fc33c3379db5 /OpenSim/Framework/Tests | |
parent | * Removes some hard-coded magic numbers relating to RegionSize. We now use Co... (diff) | |
download | opensim-SC_OLD-0266c344fb425e1338f988f542fc532e9b47aa1f.zip opensim-SC_OLD-0266c344fb425e1338f988f542fc532e9b47aa1f.tar.gz opensim-SC_OLD-0266c344fb425e1338f988f542fc532e9b47aa1f.tar.bz2 opensim-SC_OLD-0266c344fb425e1338f988f542fc532e9b47aa1f.tar.xz |
* Added NUnit tested utility function GetHashGuid() for future use.
* Did some aligning refactoring of the MD5 and SHA-1 functions.
Diffstat (limited to 'OpenSim/Framework/Tests')
-rw-r--r-- | OpenSim/Framework/Tests/UtilTest.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs index c5f1800..341cd81 100644 --- a/OpenSim/Framework/Tests/UtilTest.cs +++ b/OpenSim/Framework/Tests/UtilTest.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
28 | using NUnit.Framework; | 29 | using NUnit.Framework; |
29 | using NUnit.Framework.SyntaxHelpers; | 30 | using NUnit.Framework.SyntaxHelpers; |
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
@@ -152,5 +153,22 @@ namespace OpenSim.Framework.Tests | |||
152 | Assert.IsFalse(Util.isUUID("01234567-89ab-Cdef-0123+456789AbCdEf"), | 153 | Assert.IsFalse(Util.isUUID("01234567-89ab-Cdef-0123+456789AbCdEf"), |
153 | "UUIDs with wrong format are recognized as correct UUIDs."); | 154 | "UUIDs with wrong format are recognized as correct UUIDs."); |
154 | } | 155 | } |
156 | |||
157 | [Test] | ||
158 | public void GetHashGuidTests() | ||
159 | { | ||
160 | string string1 = "This is one string"; | ||
161 | string string2 = "This is another"; | ||
162 | |||
163 | // Two consecutive runs should equal the same | ||
164 | Assert.AreEqual(Util.GetHashGuid(string1, "secret1"), Util.GetHashGuid(string1, "secret1")); | ||
165 | Assert.AreEqual(Util.GetHashGuid(string2, "secret1"), Util.GetHashGuid(string2, "secret1")); | ||
166 | |||
167 | // Varying data should not eqal the same | ||
168 | Assert.AreNotEqual(Util.GetHashGuid(string1, "secret1"), Util.GetHashGuid(string2, "secret1")); | ||
169 | |||
170 | // Varying secrets should not eqal the same | ||
171 | Assert.AreNotEqual(Util.GetHashGuid(string1, "secret1"), Util.GetHashGuid(string1, "secret2")); | ||
172 | } | ||
155 | } | 173 | } |
156 | } | 174 | } |