summaryrefslogtreecommitdiffstats
blob: 8efe4ae38327bee329d4eb76d354c8be00cff421 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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);