mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 19:51:58 +01:00
merge fix for #878
This commit is contained in:
@@ -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&)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user