mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-26 13:56:21 +00:00
Added cmd_bookmark tests
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "ui/ui.h"
|
||||
#include "ui/window.h"
|
||||
#include "tests/helpers.h"
|
||||
|
||||
#include "xmpp/bookmark.h"
|
||||
@@ -103,6 +104,18 @@ char * _stub_ui_ask_password(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static
|
||||
win_type_t _mock_ui_current_win_type(void)
|
||||
{
|
||||
return (win_type_t)mock();
|
||||
}
|
||||
|
||||
static
|
||||
char * _mock_ui_current_recipeint(void)
|
||||
{
|
||||
return (char *)mock();
|
||||
}
|
||||
|
||||
static
|
||||
void _mock_ui_handle_error(const char * const err_msg)
|
||||
{
|
||||
@@ -198,6 +211,12 @@ mock_ui_ask_password(void)
|
||||
ui_ask_password = _mock_ui_ask_password;
|
||||
}
|
||||
|
||||
void
|
||||
mock_ui_current_recipient(void)
|
||||
{
|
||||
ui_current_recipient = _mock_ui_current_recipeint;
|
||||
}
|
||||
|
||||
void
|
||||
stub_ui_ask_password(void)
|
||||
{
|
||||
@@ -325,3 +344,16 @@ expect_ui_handle_recipient_not_found(char *recipient, char *err_msg)
|
||||
expect_string(_mock_ui_handle_recipient_not_found, recipient, recipient);
|
||||
expect_string(_mock_ui_handle_recipient_not_found, err_msg, err_msg);
|
||||
}
|
||||
|
||||
void
|
||||
mock_current_win_type(win_type_t type)
|
||||
{
|
||||
ui_current_win_type = _mock_ui_current_win_type;
|
||||
will_return(_mock_ui_current_win_type, type);
|
||||
}
|
||||
|
||||
void
|
||||
ui_current_recipient_returns(char *jid)
|
||||
{
|
||||
will_return(_mock_ui_current_recipeint, jid);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "config/account.h"
|
||||
#include "contact.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
void stub_cons_show(void);
|
||||
|
||||
@@ -43,4 +44,9 @@ void stub_ui_ask_password(void);
|
||||
void mock_ui_ask_password(void);
|
||||
void mock_ui_ask_password_returns(char *password);
|
||||
|
||||
void mock_current_win_type(win_type_t type);
|
||||
|
||||
void mock_ui_current_recipient(void);
|
||||
void ui_current_recipient_returns(char *jid);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user