summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-17 07:03:16 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-17 07:41:26 (GMT)
commit436ae921afbc5c2b461ee9b2d8fa9b1c869ed274 (patch)
tree9d209712286cc49d4c1f08be5ab8f5b90ef4971c /Swiften/LinkLocal/UnitTest
parent2c954f7e9464b8fdd970eed829e2ba632e8979d8 (diff)
downloadswift-436ae921afbc5c2b461ee9b2d8fa9b1c869ed274.zip
swift-436ae921afbc5c2b461ee9b2d8fa9b1c869ed274.tar.bz2
Implement LinkLocalServiceInfo TXT record.
Diffstat (limited to 'Swiften/LinkLocal/UnitTest')
-rw-r--r--Swiften/LinkLocal/UnitTest/LinkLocalServiceInfoTest.cpp26
-rw-r--r--Swiften/LinkLocal/UnitTest/Makefile.inc2
2 files changed, 28 insertions, 0 deletions
diff --git a/Swiften/LinkLocal/UnitTest/LinkLocalServiceInfoTest.cpp b/Swiften/LinkLocal/UnitTest/LinkLocalServiceInfoTest.cpp
new file mode 100644
index 0000000..8efe4ae
--- /dev/null
+++ b/Swiften/LinkLocal/UnitTest/LinkLocalServiceInfoTest.cpp
@@ -0,0 +1,26 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+
+#include "Swiften/LinkLocal/LinkLocalServiceInfo.h"
+
+using namespace Swift;
+
+class LinkLocalServiceInfoTest : public CppUnit::TestFixture {
+ CPPUNIT_TEST_SUITE(LinkLocalServiceInfoTest);
+ CPPUNIT_TEST(testGetTXTRecord);
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+ LinkLocalServiceInfoTest() {}
+
+ void testGetTXTRecord() {
+ LinkLocalServiceInfo info;
+ info.setFirstName("Remko");
+ info.setLastName("Tron\xc3\xe7on");
+ info.setStatus(LinkLocalServiceInfo::Away);
+
+ CPPUNIT_ASSERT_EQUAL(ByteArray("\x09txtvers=1\x09" + String("1st=Remko\x0dlast=Tron\xc3\xe7on\x0bstatus=away")), info.toTXTRecord());
+ }
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(LinkLocalServiceInfoTest);
diff --git a/Swiften/LinkLocal/UnitTest/Makefile.inc b/Swiften/LinkLocal/UnitTest/Makefile.inc
new file mode 100644
index 0000000..abc1180
--- /dev/null
+++ b/Swiften/LinkLocal/UnitTest/Makefile.inc
@@ -0,0 +1,2 @@
+UNITTEST_SOURCES += \
+ Swiften/LinkLocal/UnitTest/LinkLocalServiceInfoTest.cpp