From 499f1428f707cbb116349dc0a2f07a19658df668 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sun, 2 Nov 2008 13:07:57 +0000 Subject: - Add Util.isUUID - Add tests for Util.isUUID - First part of the fix for protocol interoperability between viewer 1.20 and 1.21 for friend offers. --- OpenSim/Framework/Tests/UtilTest.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'OpenSim/Framework/Tests') diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs index a973ed2..0224356 100644 --- a/OpenSim/Framework/Tests/UtilTest.cs +++ b/OpenSim/Framework/Tests/UtilTest.cs @@ -137,5 +137,20 @@ namespace OpenSim.Framework.Tests "Normalized vector generated from vector does not have magnitude of 1."); } } + + [Test] + public void UUIDTests() + { + Assert.IsTrue(Util.isUUID("01234567-89ab-Cdef-0123-456789AbCdEf"), + "A correct UUID wasn't recognized."); + Assert.IsFalse(Util.isUUID("FOOBAR67-89ab-Cdef-0123-456789AbCdEf"), + "UUIDs with non-hex characters are recognized as correct UUIDs."); + Assert.IsFalse(Util.isUUID("01234567"), + "Too short UUIDs are regognized as correct UUIDs."); + Assert.IsFalse(Util.isUUID("01234567-89ab-Cdef-0123-456789AbCdEf0"), + "Too long UUIDs are regognized as correct UUIDs."); + Assert.IsFalse(Util.isUUID("01234567-89ab-Cdef-0123+456789AbCdEf"), + "UUIDs with wrong format are recognized as correct UUIDs."); + } } } -- cgit v1.1