Changeset - f2385971a209
[Not reviewed]
0 1 0
Jan Kaluza - 10 years ago 2015-12-03 06:07:41
jkaluza@redhat.com
Test that STATUS_NONE can be forwarded
1 file changed with 19 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/tests/localbuddy.cpp
Show inline comments
 
@@ -21,6 +21,7 @@ class LocalBuddyTest : public CPPUNIT_NS :: TestFixture, public BasicTest {
 
	CPPUNIT_TEST(getSafeName);
 
	CPPUNIT_TEST(sendPresence);
 
	CPPUNIT_TEST(setAlias);
 
	CPPUNIT_TEST(sendPresenceTypeNone);
 
	CPPUNIT_TEST_SUITE_END();
 

	
 
	public:
 
@@ -126,6 +127,24 @@ class LocalBuddyTest : public CPPUNIT_NS :: TestFixture, public BasicTest {
 
		CPPUNIT_ASSERT_EQUAL(std::string("Buddy 2"), item.getName());
 
	}
 

	
 
	void sendPresenceTypeNone() {
 
		User *user = userManager->getUser("user@localhost");
 
		CPPUNIT_ASSERT(user);
 

	
 
		std::vector<std::string> grp;
 
		grp.push_back("group1");
 
		LocalBuddy *buddy = new LocalBuddy(user->getRosterManager(), -1, "buddy1", "Buddy 1", grp, BUDDY_JID_ESCAPING);
 
		buddy->setStatus(Swift::StatusShow(Swift::StatusShow::Away), "");
 
		user->getRosterManager()->setBuddy(buddy);
 
		received.clear();
 

	
 
		buddy->setStatus(Swift::StatusShow(Swift::StatusShow::None), "");
 
		dumpReceived();
 
		CPPUNIT_ASSERT_EQUAL(1, (int) received.size());
 
		CPPUNIT_ASSERT(dynamic_cast<Swift::Presence *>(getStanza(received[0])));
 
		CPPUNIT_ASSERT_EQUAL(Swift::StatusShow::None, dynamic_cast<Swift::Presence *>(getStanza(received[0]))->getShow());
 
	}
 

	
 
};
 

	
 
CPPUNIT_TEST_SUITE_REGISTRATION (LocalBuddyTest);
0 comments (0 inline, 0 general)