diff options
Diffstat (limited to 'Swiften/JID/UnitTest/JIDTest.cpp')
| -rw-r--r-- | Swiften/JID/UnitTest/JIDTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/JID/UnitTest/JIDTest.cpp b/Swiften/JID/UnitTest/JIDTest.cpp index 894378d..fc7583f 100644 --- a/Swiften/JID/UnitTest/JIDTest.cpp +++ b/Swiften/JID/UnitTest/JIDTest.cpp @@ -18,18 +18,19 @@ class JIDTest : public CppUnit::TestFixture CPPUNIT_TEST(testConstructorWithString_Empty); CPPUNIT_TEST(testConstructorWithString_NoResource); CPPUNIT_TEST(testConstructorWithString_NoNode); CPPUNIT_TEST(testConstructorWithString_EmptyResource); CPPUNIT_TEST(testConstructorWithString_OnlyDomain); CPPUNIT_TEST(testConstructorWithString_OnlyDomainWithDot); CPPUNIT_TEST(testConstructorWithString_OnlyDomainDotStrippedOff); CPPUNIT_TEST(testConstructorWithString_InvalidOnlyDomainSingleDot); CPPUNIT_TEST(testConstructorWithString_InvalidDomain); + CPPUNIT_TEST(testConstructorWithString_InvalidDomainOnlyDigits); CPPUNIT_TEST(testConstructorWithString_InvalidDomainEmptyLabel); CPPUNIT_TEST(testConstructorWithString_UpperCaseNode); CPPUNIT_TEST(testConstructorWithString_UpperCaseDomain); CPPUNIT_TEST(testConstructorWithString_UpperCaseResource); CPPUNIT_TEST(testConstructorWithString_EmptyNode); CPPUNIT_TEST(testConstructorWithString_EmptyDomain); CPPUNIT_TEST(testConstructorWithString_EmptyDomainWithResource); CPPUNIT_TEST(testConstructorWithString_DotDomain); CPPUNIT_TEST(testConstructorWithString_DotDomainWithResource); @@ -156,18 +157,22 @@ class JIDTest : public CppUnit::TestFixture void testConstructorWithString_InvalidOnlyDomainSingleDot() { CPPUNIT_ASSERT(!JID(".").isValid()); } void testConstructorWithString_InvalidDomain() { CPPUNIT_ASSERT(!JID("foo@bar,baz").isValid()); } + void testConstructorWithString_InvalidDomainOnlyDigits() { + CPPUNIT_ASSERT(!JID("1234").isValid()); + } + void testConstructorWithString_InvalidDomainEmptyLabel() { CPPUNIT_ASSERT(!JID("foo@bar..").isValid()); } void testConstructorWithString_UpperCaseNode() { JID testling("Fo\xCE\xA9@bar"); CPPUNIT_ASSERT_EQUAL(std::string("fo\xCF\x89"), testling.getNode()); CPPUNIT_ASSERT_EQUAL(std::string("bar"), testling.getDomain()); |
Swift