summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/JID/UnitTest/JIDTest.cpp')
-rw-r--r--Swiften/JID/UnitTest/JIDTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Swiften/JID/UnitTest/JIDTest.cpp b/Swiften/JID/UnitTest/JIDTest.cpp
index ca3e5ae..0101a4f 100644
--- a/Swiften/JID/UnitTest/JIDTest.cpp
+++ b/Swiften/JID/UnitTest/JIDTest.cpp
@@ -25,6 +25,8 @@ class JIDTest : public CppUnit::TestFixture
CPPUNIT_TEST(testConstructorWithString_UpperCaseDomain);
CPPUNIT_TEST(testConstructorWithString_UpperCaseResource);
CPPUNIT_TEST(testConstructorWithString_EmptyNode);
+ CPPUNIT_TEST(testConstructorWithString_EmptyDomain);
+ CPPUNIT_TEST(testConstructorWithString_EmptyDomainWithResource);
CPPUNIT_TEST(testConstructorWithString_IllegalResource);
CPPUNIT_TEST(testConstructorWithString_SpacesInNode);
CPPUNIT_TEST(testConstructorWithStrings);
@@ -151,6 +153,18 @@ class JIDTest : public CppUnit::TestFixture
CPPUNIT_ASSERT(!testling.isValid());
}
+ void testConstructorWithString_EmptyDomain() {
+ JID testling("bar@");
+
+ CPPUNIT_ASSERT(!testling.isValid());
+ }
+
+ void testConstructorWithString_EmptyDomainWithResource() {
+ JID testling("bar@/resource");
+
+ CPPUNIT_ASSERT(!testling.isValid());
+ }
+
void testConstructorWithString_IllegalResource() {
JID testling("foo@bar.com/\xd8\xb1\xd9\x85\xd9\x82\xd9\x87\x20\xd8\xaa\xd8\xb1\xd9\x86\xd8\xb3\x20");