Added cmd_bookmark tests
This commit is contained in:
@@ -64,6 +64,14 @@ _mock_bookmark_get_list(void)
|
||||
return (GList *)mock();
|
||||
}
|
||||
|
||||
static void
|
||||
_mock_bookmark_add(const char *jid, const char *nick, gboolean autojoin)
|
||||
{
|
||||
check_expected(jid);
|
||||
check_expected(nick);
|
||||
check_expected(autojoin);
|
||||
}
|
||||
|
||||
void
|
||||
mock_jabber_connect_with_details(void)
|
||||
{
|
||||
@@ -89,6 +97,12 @@ mock_connection_status(jabber_conn_status_t status)
|
||||
will_return(_mock_jabber_get_connection_status, status);
|
||||
}
|
||||
|
||||
void
|
||||
mock_bookmark_add(void)
|
||||
{
|
||||
bookmark_add = _mock_bookmark_add;
|
||||
}
|
||||
|
||||
void
|
||||
bookmark_get_list_returns(GList *bookmarks)
|
||||
{
|
||||
@@ -165,3 +179,15 @@ presence_update_expect(resource_presence_t presence, char *msg, int idle)
|
||||
expect_string(_mock_presence_update, msg, msg);
|
||||
expect_value(_mock_presence_update, idle, idle);
|
||||
}
|
||||
|
||||
void
|
||||
expect_bookmark_add(char *expected_jid, char *expected_nick, gboolean expected_autojoin)
|
||||
{
|
||||
expect_string(_mock_bookmark_add, jid, expected_jid);
|
||||
if (expected_nick != NULL) {
|
||||
expect_string(_mock_bookmark_add, nick, expected_nick);
|
||||
} else {
|
||||
expect_any(_mock_bookmark_add, nick);
|
||||
}
|
||||
expect_value(_mock_bookmark_add, autojoin, expected_autojoin);
|
||||
}
|
||||
|
||||
@@ -23,4 +23,7 @@ void presence_update_expect(resource_presence_t presence, char *msg, int idle);
|
||||
|
||||
void bookmark_get_list_returns(GList *bookmarks);
|
||||
|
||||
void mock_bookmark_add(void);
|
||||
void expect_bookmark_add(char *expected_jid, char *expected_nick, gboolean expected_autojoin);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user