Added test for /join with nick option

This commit is contained in:
James Booth
2014-03-08 21:10:23 +00:00
parent e9b5d3294b
commit dd1ee18c72
13 changed files with 77 additions and 436 deletions

View File

@@ -88,6 +88,14 @@ _mock_message_send(const char * const msg, const char * const recipient)
check_expected(recipient);
}
static void
_mock_presence_join_room(char *room, char*nick, char *passwd)
{
check_expected(room);
check_expected(nick);
check_expected(passwd);
}
void
mock_jabber_connect_with_details(void)
{
@@ -125,6 +133,12 @@ mock_bookmark_remove(void)
bookmark_remove = _mock_bookmark_remove;
}
void
mock_presence_join_room(void)
{
presence_join_room = _mock_presence_join_room;
}
void
bookmark_get_list_returns(GList *bookmarks)
{
@@ -234,3 +248,15 @@ message_send_expect(char *message, char *recipient)
expect_string(_mock_message_send, msg, message);
expect_string(_mock_message_send, recipient, recipient);
}
void
presence_join_room_expect(char *room, char *nick, char *passwd)
{
expect_string(_mock_presence_join_room, room, room);
expect_string(_mock_presence_join_room, nick, nick);
if (passwd == NULL) {
expect_any(_mock_presence_join_room, passwd);
} else {
expect_string(_mock_presence_join_room, passwd, passwd);
}
}

View File

@@ -33,4 +33,7 @@ void expect_and_return_bookmark_remove(char *expected_jid, gboolean expected_aut
void message_send_expect(char *message, char *recipient);
void mock_presence_join_room(void);
void presence_join_room_expect(char *room, char *nick, char *passwd);
#endif