diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/UnitTest')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp index c95ae10..e75695f 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp @@ -5,15 +5,13 @@ using namespace Swift; -class SecurityLabelSerializerTest : public CppUnit::TestFixture -{ +class SecurityLabelSerializerTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(SecurityLabelSerializerTest); CPPUNIT_TEST(testSerialize); + CPPUNIT_TEST(testSerialize_EmptyLabel); CPPUNIT_TEST_SUITE_END(); public: - SecurityLabelSerializerTest() {} - void testSerialize() { SecurityLabelSerializer testling; boost::shared_ptr<SecurityLabel> securityLabel(new SecurityLabel()); @@ -38,6 +36,19 @@ class SecurityLabelSerializerTest : public CppUnit::TestFixture "</equivalentlabel>" "</securitylabel>"), testling.serialize(securityLabel)); } + + void testSerialize_EmptyLabel() { + SecurityLabelSerializer testling; + boost::shared_ptr<SecurityLabel> securityLabel(new SecurityLabel()); + securityLabel->setDisplayMarking("SECRET"); + securityLabel->setLabel(""); + + CPPUNIT_ASSERT_EQUAL(String( + "<securitylabel xmlns=\"urn:xmpp:sec-label:0\">" + "<displaymarking>SECRET</displaymarking>" + "<label></label>" + "</securitylabel>"), testling.serialize(securityLabel)); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(SecurityLabelSerializerTest); |