summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/JID/UnitTest')
-rw-r--r--Swiften/JID/UnitTest/JIDTest.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Swiften/JID/UnitTest/JIDTest.cpp b/Swiften/JID/UnitTest/JIDTest.cpp
index 307243a..8f43576 100644
--- a/Swiften/JID/UnitTest/JIDTest.cpp
+++ b/Swiften/JID/UnitTest/JIDTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -28,6 +28,7 @@ class JIDTest : public CppUnit::TestFixture
CPPUNIT_TEST(testConstructorWithString_SpacesInNode);
CPPUNIT_TEST(testConstructorWithStrings);
CPPUNIT_TEST(testConstructorWithStrings_EmptyDomain);
+ CPPUNIT_TEST(testConstructorWithStrings_EmptyResource);
CPPUNIT_TEST(testIsBare);
CPPUNIT_TEST(testIsBare_NotBare);
CPPUNIT_TEST(testToBare);
@@ -154,7 +155,7 @@ class JIDTest : public CppUnit::TestFixture
CPPUNIT_ASSERT(!JID(" alice@wonderland.lit").isValid());
CPPUNIT_ASSERT(!JID("alice @wonderland.lit").isValid());
}
-
+
void testConstructorWithStrings() {
JID testling("foo", "bar", "baz");
@@ -170,6 +171,12 @@ class JIDTest : public CppUnit::TestFixture
CPPUNIT_ASSERT(!testling.isValid());
}
+ void testConstructorWithStrings_EmptyResource() {
+ JID testling("foo", "bar", "");
+
+ CPPUNIT_ASSERT(!testling.isValid());
+ }
+
void testIsBare() {
CPPUNIT_ASSERT(JID("foo@bar").isBare());
}