merge fix for #878

This commit is contained in:
Guenter Obiltschnig
2015-07-31 12:17:20 +02:00
parent 5781bcbe35
commit e4dcb85c1f
6 changed files with 116 additions and 20 deletions

View File

@@ -14,6 +14,7 @@
#include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h"
#include "Poco/UUID.h"
#include "Poco/Exception.h"
using Poco::UUID;
@@ -39,6 +40,60 @@ void UUIDTest::testParse()
uuid.parse("6BA7B8109DAD11D180B400C04FD430C8");
assert (uuid.toString() == "6ba7b810-9dad-11d1-80b4-00c04fd430c8");
try
{
uuid.parse("6xA7B8109DAD11D180B400C04FD430C8");
fail("invalid UUID - must throw");
}
catch (Poco::SyntaxException&)
{
}
try
{
uuid.parse("6xa7b810-9dad-11d1-80b4-00c04fd430c8");
fail("invalid UUID - must throw");
}
catch (Poco::SyntaxException&)
{
}
try
{
uuid.parse("6ba7b810-xdad-11d1-80b4-00c04fd430c8");
fail("invalid UUID - must throw");
}
catch (Poco::SyntaxException&)
{
}
try
{
uuid.parse("6ba7b810-9dad-x1d1-80b4-00c04fd430c8");
fail("invalid UUID - must throw");
}
catch (Poco::SyntaxException&)
{
}
try
{
uuid.parse("6ba7b810-9dad-11d1-x0b4-00c04fd430c8");
fail("invalid UUID - must throw");
}
catch (Poco::SyntaxException&)
{
}
try
{
uuid.parse("6ba7b810-9dad-11d1-80b4-00x04fd430c8");
fail("invalid UUID - must throw");
}
catch (Poco::SyntaxException&)
{
}
}