summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-01-03 09:57:25 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-01-03 09:57:25 (GMT)
commit3ca52c5c19d3e750f6ed8b5f7c06b78183eaabfb (patch)
tree7e283eed7e3565d03b60be1c55b613fbdcf46ae6 /Swiften/Serializer/PayloadSerializers/UnitTest
parente30322061756a64cd23d949e16f21dfe2f18b192 (diff)
downloadswift-3ca52c5c19d3e750f6ed8b5f7c06b78183eaabfb.zip
swift-3ca52c5c19d3e750f6ed8b5f7c06b78183eaabfb.tar.bz2
Always send <label/> element.
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/UnitTest')
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp19
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);