diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-08-27 17:24:48 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-08-27 17:26:08 (GMT) |
commit | 6137a266fd5f8d5953f7fa4baeee339d27f0caee (patch) | |
tree | a553176ffe9a786db2531346fdf8005333b1262a /Swiften/JID/UnitTest/JIDTest.cpp | |
parent | fd86fb8f38343e0eda229cd857ef03ed5c8a34e4 (diff) | |
download | swift-contrib-6137a266fd5f8d5953f7fa4baeee339d27f0caee.zip swift-contrib-6137a266fd5f8d5953f7fa4baeee339d27f0caee.tar.bz2 |
Mark JIDs with empty domains as invalid when StringPrep cache is disabled.
We used to only do this correctly in the default compilation setting
where the cache is enabled.
Resolves: #965
Diffstat (limited to 'Swiften/JID/UnitTest/JIDTest.cpp')
-rw-r--r-- | Swiften/JID/UnitTest/JIDTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Swiften/JID/UnitTest/JIDTest.cpp b/Swiften/JID/UnitTest/JIDTest.cpp index f406635..e083918 100644 --- a/Swiften/JID/UnitTest/JIDTest.cpp +++ b/Swiften/JID/UnitTest/JIDTest.cpp @@ -19,18 +19,19 @@ class JIDTest : public CppUnit::TestFixture CPPUNIT_TEST(testConstructorWithString_NoNode); CPPUNIT_TEST(testConstructorWithString_EmptyResource); CPPUNIT_TEST(testConstructorWithString_OnlyDomain); CPPUNIT_TEST(testConstructorWithString_UpperCaseNode); CPPUNIT_TEST(testConstructorWithString_UpperCaseDomain); CPPUNIT_TEST(testConstructorWithString_UpperCaseResource); CPPUNIT_TEST(testConstructorWithString_EmptyNode); CPPUNIT_TEST(testConstructorWithString_IllegalResource); CPPUNIT_TEST(testConstructorWithStrings); + CPPUNIT_TEST(testConstructorWithStrings_EmptyDomain); CPPUNIT_TEST(testIsBare); CPPUNIT_TEST(testIsBare_NotBare); CPPUNIT_TEST(testToBare); CPPUNIT_TEST(testToBare_EmptyNode); CPPUNIT_TEST(testToBare_EmptyResource); CPPUNIT_TEST(testToString); CPPUNIT_TEST(testToString_EmptyNode); CPPUNIT_TEST(testToString_EmptyResource); CPPUNIT_TEST(testToString_NoResource); @@ -133,18 +134,24 @@ class JIDTest : public CppUnit::TestFixture void testConstructorWithStrings() { JID testling("foo", "bar", "baz"); CPPUNIT_ASSERT_EQUAL(std::string("foo"), testling.getNode()); CPPUNIT_ASSERT_EQUAL(std::string("bar"), testling.getDomain()); CPPUNIT_ASSERT_EQUAL(std::string("baz"), testling.getResource()); } + void testConstructorWithStrings_EmptyDomain() { + JID testling("foo", "", "baz"); + + CPPUNIT_ASSERT(!testling.isValid()); + } + void testIsBare() { CPPUNIT_ASSERT(JID("foo@bar").isBare()); } void testIsBare_NotBare() { CPPUNIT_ASSERT(!JID("foo@bar/baz").isBare()); } void testToBare() { |