From 41fe8c22b1f8c1cf666d42052cd73d59e40a2ed2 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 14 Feb 2016 22:28:55 +0000 Subject: Added C plugin code from plugins branch --- tests/unittests/test_cmd_account.c | 2 +- tests/unittests/test_cmd_otr.c | 6 +++--- tests/unittests/test_cmd_otr.h | 4 ++-- tests/unittests/test_cmd_pgp.c | 4 ++-- tests/unittests/test_cmd_pgp.h | 4 ++-- tests/unittests/ui/stub_ui.c | 19 ++++++++++++++----- tests/unittests/unittests.c | 9 ++++----- 7 files changed, 28 insertions(+), 20 deletions(-) (limited to 'tests/unittests') diff --git a/tests/unittests/test_cmd_account.c b/tests/unittests/test_cmd_account.c index 4b49867f..6eecaac9 100644 --- a/tests/unittests/test_cmd_account.c +++ b/tests/unittests/test_cmd_account.c @@ -798,7 +798,7 @@ void cmd_account_set_priority_updates_presence_when_account_connected_with_prese will_return(jabber_get_account_name, "a_account"); -#ifdef HAVE_LIBGPGME +#ifdef PROF_HAVE_LIBGPGME ProfAccount *account = account_new("a_account", "a_jid", NULL, NULL, TRUE, NULL, 5222, "a_resource", NULL, NULL, 10, 10, 10, 10, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/unittests/test_cmd_otr.c b/tests/unittests/test_cmd_otr.c index fdadcb0e..fbfa6cb2 100644 --- a/tests/unittests/test_cmd_otr.c +++ b/tests/unittests/test_cmd_otr.c @@ -6,9 +6,9 @@ #include #include -#include "config.h" +#include "prof_config.h" -#ifdef HAVE_LIBOTR +#ifdef PROF_HAVE_LIBOTR #include #include "otr/otr.h" #endif @@ -24,7 +24,7 @@ #define CMD_OTR "/otr" -#ifdef HAVE_LIBOTR +#ifdef PROF_HAVE_LIBOTR void cmd_otr_shows_usage_when_no_args(void **state) { gchar *args[] = { NULL }; diff --git a/tests/unittests/test_cmd_otr.h b/tests/unittests/test_cmd_otr.h index 469d7c54..06367041 100644 --- a/tests/unittests/test_cmd_otr.h +++ b/tests/unittests/test_cmd_otr.h @@ -1,6 +1,6 @@ -#include "config.h" +#include "prof_config.h" -#ifdef HAVE_LIBOTR +#ifdef PROF_HAVE_LIBOTR void cmd_otr_shows_usage_when_no_args(void **state); void cmd_otr_shows_usage_when_invalid_subcommand(void **state); void cmd_otr_log_shows_usage_when_no_args(void **state); diff --git a/tests/unittests/test_cmd_pgp.c b/tests/unittests/test_cmd_pgp.c index b1d0ab52..79d617ae 100644 --- a/tests/unittests/test_cmd_pgp.c +++ b/tests/unittests/test_cmd_pgp.c @@ -6,7 +6,7 @@ #include #include -#include "config.h" +#include "prof_config.h" #include "command/commands.h" @@ -14,7 +14,7 @@ #define CMD_PGP "/pgp" -#ifdef HAVE_LIBGPGME +#ifdef PROF_HAVE_LIBGPGME void cmd_pgp_shows_usage_when_no_args(void **state) { gchar *args[] = { NULL }; diff --git a/tests/unittests/test_cmd_pgp.h b/tests/unittests/test_cmd_pgp.h index fcb24500..e6f38192 100644 --- a/tests/unittests/test_cmd_pgp.h +++ b/tests/unittests/test_cmd_pgp.h @@ -1,6 +1,6 @@ -#include "config.h" +#include "prof_config.h" -#ifdef HAVE_LIBGPGME +#ifdef PROF_HAVE_LIBGPGME void cmd_pgp_shows_usage_when_no_args(void **state); void cmd_pgp_start_shows_message_when_disconnected(void **state); void cmd_pgp_start_shows_message_when_disconnecting(void **state); diff --git a/tests/unittests/ui/stub_ui.c b/tests/unittests/ui/stub_ui.c index 79c9a6cf..3381c2c6 100644 --- a/tests/unittests/ui/stub_ui.c +++ b/tests/unittests/ui/stub_ui.c @@ -1,4 +1,4 @@ -#include "config.h" +#include "prof_config.h" #include #include @@ -8,7 +8,7 @@ #include "ui/window.h" #include "ui/ui.h" -#ifdef HAVE_LIBOTR +#ifdef PROF_HAVE_LIBOTR #include "otr/otr.h" #endif @@ -67,7 +67,7 @@ void ui_resize(void) {} void ui_focus_win(ProfWin *win) {} -#ifdef HAVE_LIBOTR +#ifdef PROF_HAVE_LIBOTR void chatwin_otr_secured(ProfChatWin *chatwin, gboolean trusted) {} void chatwin_otr_unsecured(ProfChatWin *chatwin) {} void chatwin_otr_trust(ProfChatWin *chatwin) {} @@ -303,8 +303,10 @@ gboolean ui_win_has_unsaved_form(int num) return FALSE; } -void -ui_write(char *line, int offset) {} +void ui_status_bar_inactive(const int win) {} +void ui_status_bar_active(const int win) {} +void ui_status_bar_new(const int win) {} +void ui_write(char *line, int offset) {} // console window actions @@ -494,6 +496,10 @@ ProfWin* win_create_private(const char * const fulljid) { return NULL; } +ProfWin* win_create_plugin(const char * const tag) +{ + return NULL; +} void win_update_virtual(ProfWin *window) {} void win_free(ProfWin *window) {} @@ -540,3 +546,6 @@ void notify_remind(void) {} void notify_invite(const char * const from, const char * const room, const char * const reason) {} void notify_subscription(const char * const from) {} +void notify(const char * const message, int timeout, + const char * const category) {} + diff --git a/tests/unittests/unittests.c b/tests/unittests/unittests.c index c9c1a662..61143ce0 100644 --- a/tests/unittests/unittests.c +++ b/tests/unittests/unittests.c @@ -7,9 +7,8 @@ #include #include -#include "config.h" +#include "prof_config.h" #include "chat_session.h" - #include "helpers.h" #include "test_autocomplete.h" #include "test_chat_session.h" @@ -356,7 +355,7 @@ int main(int argc, char* argv[]) { unit_test(cmd_account_set_eval_password_when_password_set), unit_test(cmd_account_set_muc_sets_muc), unit_test(cmd_account_set_nick_sets_nick), -#ifdef HAVE_LIBOTR +#ifdef PROF_HAVE_LIBOTR unit_test(cmd_account_show_message_for_missing_otr_policy), unit_test(cmd_account_show_message_for_invalid_otr_policy), unit_test(cmd_account_set_otr_sets_otr), @@ -505,7 +504,7 @@ int main(int argc, char* argv[]) { unit_test(cmd_bookmark_remove_removes_bookmark), unit_test(cmd_bookmark_remove_shows_message_when_no_bookmark), -#ifdef HAVE_LIBOTR +#ifdef PROF_HAVE_LIBOTR unit_test(cmd_otr_shows_usage_when_no_args), unit_test(cmd_otr_shows_usage_when_invalid_subcommand), unit_test(cmd_otr_log_shows_usage_when_no_args), @@ -557,7 +556,7 @@ int main(int argc, char* argv[]) { unit_test(cmd_otr_shows_message_when_otr_unsupported), #endif -#ifdef HAVE_LIBGPGME +#ifdef PROF_HAVE_LIBGPGME unit_test(cmd_pgp_shows_usage_when_no_args), unit_test(cmd_pgp_start_shows_message_when_disconnected), unit_test(cmd_pgp_start_shows_message_when_disconnecting), -- cgit 1.4.1-2-gfad0