1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-10-27 20:30:13 -04:00

Use mock_type() for casting mock()

This commit is contained in:
Frank Zschockelt 2019-05-08 21:52:16 +02:00
parent a5db791dc4
commit 4683395aca
4 changed files with 13 additions and 13 deletions

View File

@ -48,13 +48,13 @@ ProfAccount* accounts_get_account(const char * const name)
gboolean accounts_enable(const char * const name) gboolean accounts_enable(const char * const name)
{ {
check_expected(name); check_expected(name);
return (gboolean)mock(); return mock_type(gboolean);
} }
gboolean accounts_disable(const char * const name) gboolean accounts_disable(const char * const name)
{ {
check_expected(name); check_expected(name);
return (gboolean)mock(); return mock_type(gboolean);
} }
gboolean accounts_rename(const char * const account_name, gboolean accounts_rename(const char * const account_name,
@ -62,13 +62,13 @@ gboolean accounts_rename(const char * const account_name,
{ {
check_expected(account_name); check_expected(account_name);
check_expected(new_name); check_expected(new_name);
return (gboolean)mock(); return mock_type(gboolean);
} }
gboolean accounts_account_exists(const char * const account_name) gboolean accounts_account_exists(const char * const account_name)
{ {
check_expected(account_name); check_expected(account_name);
return (gboolean)mock(); return mock_type(gboolean);
} }
void accounts_set_jid(const char * const account_name, const char * const value) void accounts_set_jid(const char * const account_name, const char * const value)
@ -148,7 +148,7 @@ char * accounts_get_last_status(const char * const account_name)
resource_presence_t accounts_get_last_presence(const char * const account_name) resource_presence_t accounts_get_last_presence(const char * const account_name)
{ {
check_expected(account_name); check_expected(account_name);
return (resource_presence_t)mock(); return mock_type(resource_presence_t);
} }
void accounts_set_priority_online(const char * const account_name, const gint value) void accounts_set_priority_online(const char * const account_name, const gint value)

View File

@ -29,7 +29,7 @@
void log_init(log_level_t filter) {} void log_init(log_level_t filter) {}
log_level_t log_get_filter(void) log_level_t log_get_filter(void)
{ {
return (log_level_t)mock(); return mock_type(log_level_t);
} }
void log_reinit(void) {} void log_reinit(void) {}
void log_close(void) {} void log_close(void) {}
@ -46,7 +46,7 @@ char * get_log_file_location(void)
log_level_t log_level_from_string(char *log_level) log_level_t log_level_from_string(char *log_level)
{ {
return (log_level_t)mock(); return mock_type(log_level_t);
} }
void log_stderr_init(log_level_t level) {} void log_stderr_init(log_level_t level) {}

View File

@ -57,7 +57,7 @@ void otr_keygen(ProfAccount *account)
gboolean otr_key_loaded(void) gboolean otr_key_loaded(void)
{ {
return (gboolean)mock(); return mock_type(gboolean);
} }
char* otr_tag_message(const char * const msg) char* otr_tag_message(const char * const msg)

View File

@ -17,13 +17,13 @@ jabber_conn_status_t session_connect_with_details(const char * const jid,
check_expected(passwd); check_expected(passwd);
check_expected(altdomain); check_expected(altdomain);
check_expected(port); check_expected(port);
return (jabber_conn_status_t)mock(); return mock_type(jabber_conn_status_t);
} }
jabber_conn_status_t session_connect_with_account(const ProfAccount * const account) jabber_conn_status_t session_connect_with_account(const ProfAccount * const account)
{ {
check_expected(account); check_expected(account);
return (jabber_conn_status_t)mock(); return mock_type(jabber_conn_status_t);
} }
void session_disconnect(void) {} void session_disconnect(void) {}
@ -60,7 +60,7 @@ void connection_free_uuid(char * uuid) {}
jabber_conn_status_t connection_get_status(void) jabber_conn_status_t connection_get_status(void)
{ {
return (jabber_conn_status_t)mock(); return mock_type(jabber_conn_status_t);
} }
char* connection_get_presence_msg(void) char* connection_get_presence_msg(void)
@ -233,7 +233,7 @@ gboolean bookmark_add(const char *jid, const char *nick, const char *password, c
check_expected(nick); check_expected(nick);
check_expected(password); check_expected(password);
check_expected(autojoin_str); check_expected(autojoin_str);
return (gboolean)mock(); return mock_type(gboolean);
} }
gboolean bookmark_update(const char *jid, const char *nick, const char *password, const char *autojoin_str) gboolean bookmark_update(const char *jid, const char *nick, const char *password, const char *autojoin_str)
@ -244,7 +244,7 @@ gboolean bookmark_update(const char *jid, const char *nick, const char *password
gboolean bookmark_remove(const char *jid) gboolean bookmark_remove(const char *jid)
{ {
check_expected(jid); check_expected(jid);
return (gboolean)mock(); return mock_type(gboolean);
} }
gboolean bookmark_join(const char *jid) gboolean bookmark_join(const char *jid)