2013-12-14 11:07:57 -05:00
|
|
|
#include <stdarg.h>
|
2014-01-18 21:11:52 -05:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
2013-12-14 11:07:57 -05:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <setjmp.h>
|
|
|
|
#include <cmocka.h>
|
2014-01-28 19:30:12 -05:00
|
|
|
#include <sys/stat.h>
|
2012-03-01 20:51:40 -05:00
|
|
|
|
2014-02-15 19:04:53 -05:00
|
|
|
#include "config.h"
|
|
|
|
|
2014-02-01 11:32:36 -05:00
|
|
|
#include "helpers.h"
|
2013-12-14 11:16:46 -05:00
|
|
|
#include "test_autocomplete.h"
|
2013-12-14 11:07:57 -05:00
|
|
|
#include "test_common.h"
|
2014-01-04 19:35:48 -05:00
|
|
|
#include "test_contact.h"
|
2013-12-15 13:08:26 -05:00
|
|
|
#include "test_cmd_connect.h"
|
2013-12-15 17:28:22 -05:00
|
|
|
#include "test_cmd_account.h"
|
2013-12-15 13:08:26 -05:00
|
|
|
#include "test_cmd_rooms.h"
|
2013-12-27 12:25:30 -05:00
|
|
|
#include "test_cmd_sub.h"
|
2014-01-18 20:25:04 -05:00
|
|
|
#include "test_cmd_statuses.h"
|
2014-02-15 19:04:53 -05:00
|
|
|
#include "test_cmd_otr.h"
|
2013-12-14 11:35:56 -05:00
|
|
|
#include "test_history.h"
|
|
|
|
#include "test_jid.h"
|
2013-12-14 11:48:27 -05:00
|
|
|
#include "test_parser.h"
|
2013-12-14 12:03:39 -05:00
|
|
|
#include "test_roster_list.h"
|
2014-01-19 12:20:31 -05:00
|
|
|
#include "test_preferences.h"
|
2014-01-20 13:40:48 -05:00
|
|
|
#include "test_server_events.h"
|
2014-01-23 17:29:53 -05:00
|
|
|
#include "test_cmd_alias.h"
|
2014-02-01 11:16:56 -05:00
|
|
|
#include "test_cmd_bookmark.h"
|
2014-03-07 19:07:38 -05:00
|
|
|
#include "test_cmd_join.h"
|
2014-01-30 18:32:52 -05:00
|
|
|
#include "test_muc.h"
|
2013-12-14 11:07:57 -05:00
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
2014-02-01 20:13:17 -05:00
|
|
|
const UnitTest all_tests[] = {
|
2013-12-14 11:07:57 -05:00
|
|
|
unit_test(replace_one_substr),
|
|
|
|
unit_test(replace_one_substr_beginning),
|
|
|
|
unit_test(replace_one_substr_end),
|
|
|
|
unit_test(replace_two_substr),
|
|
|
|
unit_test(replace_char),
|
|
|
|
unit_test(replace_when_none),
|
|
|
|
unit_test(replace_when_match),
|
|
|
|
unit_test(replace_when_string_empty),
|
|
|
|
unit_test(replace_when_string_null),
|
|
|
|
unit_test(replace_when_sub_empty),
|
|
|
|
unit_test(replace_when_sub_null),
|
|
|
|
unit_test(replace_when_new_empty),
|
|
|
|
unit_test(replace_when_new_null),
|
|
|
|
unit_test(compare_win_nums_less),
|
|
|
|
unit_test(compare_win_nums_equal),
|
|
|
|
unit_test(compare_win_nums_greater),
|
|
|
|
unit_test(compare_0s_equal),
|
|
|
|
unit_test(compare_0_greater_than_1),
|
|
|
|
unit_test(compare_1_less_than_0),
|
|
|
|
unit_test(compare_0_less_than_11),
|
|
|
|
unit_test(compare_11_greater_than_0),
|
|
|
|
unit_test(compare_0_greater_than_9),
|
|
|
|
unit_test(compare_9_less_than_0),
|
|
|
|
unit_test(next_available_when_only_console),
|
|
|
|
unit_test(next_available_3_at_end),
|
|
|
|
unit_test(next_available_9_at_end),
|
|
|
|
unit_test(next_available_0_at_end),
|
|
|
|
unit_test(next_available_2_in_first_gap),
|
|
|
|
unit_test(next_available_9_in_first_gap),
|
|
|
|
unit_test(next_available_0_in_first_gap),
|
|
|
|
unit_test(next_available_11_in_first_gap),
|
2013-12-14 11:16:46 -05:00
|
|
|
unit_test(next_available_24_first_big_gap),
|
2013-12-17 17:58:27 -05:00
|
|
|
unit_test(test_online_is_valid_resource_presence_string),
|
|
|
|
unit_test(test_chat_is_valid_resource_presence_string),
|
|
|
|
unit_test(test_away_is_valid_resource_presence_string),
|
|
|
|
unit_test(test_xa_is_valid_resource_presence_string),
|
|
|
|
unit_test(test_dnd_is_valid_resource_presence_string),
|
|
|
|
unit_test(test_available_is_not_valid_resource_presence_string),
|
|
|
|
unit_test(test_unavailable_is_not_valid_resource_presence_string),
|
|
|
|
unit_test(test_blah_is_not_valid_resource_presence_string),
|
2013-12-14 11:16:46 -05:00
|
|
|
|
|
|
|
unit_test(clear_empty),
|
|
|
|
unit_test(reset_after_create),
|
|
|
|
unit_test(find_after_create),
|
|
|
|
unit_test(get_after_create_returns_null),
|
|
|
|
unit_test(add_one_and_complete),
|
|
|
|
unit_test(add_two_and_complete_returns_first),
|
|
|
|
unit_test(add_two_and_complete_returns_second),
|
|
|
|
unit_test(add_two_adds_two),
|
|
|
|
unit_test(add_two_same_adds_one),
|
2013-12-14 11:35:56 -05:00
|
|
|
unit_test(add_two_same_updates),
|
|
|
|
|
|
|
|
unit_test(previous_on_empty_returns_null),
|
|
|
|
unit_test(next_on_empty_returns_null),
|
|
|
|
unit_test(previous_once_returns_last),
|
|
|
|
unit_test(previous_twice_when_one_returns_first),
|
|
|
|
unit_test(previous_always_stops_at_first),
|
|
|
|
unit_test(previous_goes_to_correct_element),
|
|
|
|
unit_test(prev_then_next_returns_empty),
|
|
|
|
unit_test(prev_with_val_then_next_returns_val),
|
|
|
|
unit_test(prev_with_val_then_next_twice_returns_null),
|
|
|
|
unit_test(navigate_then_append_new),
|
|
|
|
unit_test(edit_item_mid_history),
|
|
|
|
unit_test(edit_previous_and_append),
|
|
|
|
unit_test(start_session_add_new_submit_previous),
|
|
|
|
|
|
|
|
unit_test(create_jid_from_null_returns_null),
|
|
|
|
unit_test(create_jid_from_empty_string_returns_null),
|
|
|
|
unit_test(create_jid_from_full_returns_full),
|
|
|
|
unit_test(create_jid_from_full_returns_bare),
|
|
|
|
unit_test(create_jid_from_full_returns_resourcepart),
|
|
|
|
unit_test(create_jid_from_full_returns_localpart),
|
|
|
|
unit_test(create_jid_from_full_returns_domainpart),
|
|
|
|
unit_test(create_jid_from_full_nolocal_returns_full),
|
|
|
|
unit_test(create_jid_from_full_nolocal_returns_bare),
|
|
|
|
unit_test(create_jid_from_full_nolocal_returns_resourcepart),
|
|
|
|
unit_test(create_jid_from_full_nolocal_returns_domainpart),
|
|
|
|
unit_test(create_jid_from_full_nolocal_returns_null_localpart),
|
|
|
|
unit_test(create_jid_from_bare_returns_null_full),
|
|
|
|
unit_test(create_jid_from_bare_returns_null_resource),
|
|
|
|
unit_test(create_jid_from_bare_returns_bare),
|
|
|
|
unit_test(create_jid_from_bare_returns_localpart),
|
|
|
|
unit_test(create_jid_from_bare_returns_domainpart),
|
|
|
|
unit_test(create_room_jid_returns_room),
|
|
|
|
unit_test(create_room_jid_returns_nick),
|
|
|
|
unit_test(create_with_slash_in_resource),
|
|
|
|
unit_test(create_with_at_in_resource),
|
|
|
|
unit_test(create_with_at_and_slash_in_resource),
|
2013-12-14 11:48:27 -05:00
|
|
|
unit_test(create_full_with_trailing_slash),
|
|
|
|
|
|
|
|
unit_test(parse_null_returns_null),
|
|
|
|
unit_test(parse_empty_returns_null),
|
|
|
|
unit_test(parse_space_returns_null),
|
|
|
|
unit_test(parse_cmd_no_args_returns_null),
|
|
|
|
unit_test(parse_cmd_with_space_returns_null),
|
|
|
|
unit_test(parse_cmd_with_too_few_returns_null),
|
|
|
|
unit_test(parse_cmd_with_too_many_returns_null),
|
|
|
|
unit_test(parse_cmd_one_arg),
|
|
|
|
unit_test(parse_cmd_two_args),
|
|
|
|
unit_test(parse_cmd_three_args),
|
|
|
|
unit_test(parse_cmd_three_args_with_spaces),
|
|
|
|
unit_test(parse_cmd_with_freetext),
|
|
|
|
unit_test(parse_cmd_one_arg_with_freetext),
|
|
|
|
unit_test(parse_cmd_two_args_with_freetext),
|
|
|
|
unit_test(parse_cmd_min_zero),
|
|
|
|
unit_test(parse_cmd_min_zero_with_freetext),
|
|
|
|
unit_test(parse_cmd_with_quoted),
|
|
|
|
unit_test(parse_cmd_with_quoted_and_space),
|
|
|
|
unit_test(parse_cmd_with_quoted_and_many_spaces),
|
|
|
|
unit_test(parse_cmd_with_many_quoted_and_many_spaces),
|
|
|
|
unit_test(parse_cmd_freetext_with_quoted),
|
|
|
|
unit_test(parse_cmd_freetext_with_quoted_and_space),
|
|
|
|
unit_test(parse_cmd_freetext_with_quoted_and_many_spaces),
|
|
|
|
unit_test(parse_cmd_freetext_with_many_quoted_and_many_spaces),
|
|
|
|
unit_test(parse_cmd_with_quoted_freetext),
|
|
|
|
unit_test(parse_cmd_with_third_arg_quoted_0_min_3_max),
|
|
|
|
unit_test(parse_cmd_with_second_arg_quoted_0_min_3_max),
|
|
|
|
unit_test(parse_cmd_with_second_and_third_arg_quoted_0_min_3_max),
|
|
|
|
unit_test(count_one_token),
|
|
|
|
unit_test(count_one_token_quoted_no_whitespace),
|
|
|
|
unit_test(count_one_token_quoted_with_whitespace),
|
|
|
|
unit_test(count_two_tokens),
|
|
|
|
unit_test(count_two_tokens_first_quoted),
|
|
|
|
unit_test(count_two_tokens_second_quoted),
|
|
|
|
unit_test(count_two_tokens_both_quoted),
|
|
|
|
unit_test(get_first_of_one),
|
|
|
|
unit_test(get_first_of_two),
|
|
|
|
unit_test(get_first_two_of_three),
|
|
|
|
unit_test(get_first_two_of_three_first_quoted),
|
|
|
|
unit_test(get_first_two_of_three_second_quoted),
|
|
|
|
unit_test(get_first_two_of_three_first_and_second_quoted),
|
2013-12-14 12:03:39 -05:00
|
|
|
|
|
|
|
unit_test(empty_list_when_none_added),
|
|
|
|
unit_test(contains_one_element),
|
|
|
|
unit_test(first_element_correct),
|
|
|
|
unit_test(contains_two_elements),
|
|
|
|
unit_test(first_and_second_elements_correct),
|
|
|
|
unit_test(contains_three_elements),
|
|
|
|
unit_test(first_three_elements_correct),
|
|
|
|
unit_test(add_twice_at_beginning_adds_once),
|
|
|
|
unit_test(add_twice_in_middle_adds_once),
|
|
|
|
unit_test(add_twice_at_end_adds_once),
|
|
|
|
unit_test(find_first_exists),
|
|
|
|
unit_test(find_second_exists),
|
|
|
|
unit_test(find_third_exists),
|
|
|
|
unit_test(find_returns_null),
|
|
|
|
unit_test(find_on_empty_returns_null),
|
|
|
|
unit_test(find_twice_returns_second_when_two_match),
|
|
|
|
unit_test(find_five_times_finds_fifth),
|
|
|
|
unit_test(find_twice_returns_first_when_two_match_and_reset),
|
2013-12-15 20:04:25 -05:00
|
|
|
|
|
|
|
unit_test(cmd_connect_shows_message_when_disconnecting),
|
|
|
|
unit_test(cmd_connect_shows_message_when_connecting),
|
|
|
|
unit_test(cmd_connect_shows_message_when_connected),
|
|
|
|
unit_test(cmd_connect_shows_message_when_undefined),
|
|
|
|
unit_test(cmd_connect_when_no_account),
|
|
|
|
unit_test(cmd_connect_fail_message),
|
|
|
|
unit_test(cmd_connect_lowercases_argument),
|
|
|
|
unit_test(cmd_connect_asks_password_when_not_in_account),
|
|
|
|
unit_test(cmd_connect_shows_message_when_connecting_with_account),
|
|
|
|
unit_test(cmd_connect_connects_with_account),
|
2014-01-18 16:18:25 -05:00
|
|
|
unit_test(cmd_connect_shows_usage_when_no_server_value),
|
|
|
|
unit_test(cmd_connect_shows_usage_when_server_no_port_value),
|
|
|
|
unit_test(cmd_connect_shows_usage_when_no_port_value),
|
|
|
|
unit_test(cmd_connect_shows_usage_when_port_no_server_value),
|
|
|
|
unit_test(cmd_connect_shows_message_when_port_0),
|
|
|
|
unit_test(cmd_connect_shows_message_when_port_minus1),
|
|
|
|
unit_test(cmd_connect_shows_message_when_port_65536),
|
|
|
|
unit_test(cmd_connect_shows_message_when_port_contains_chars),
|
2014-01-18 17:02:51 -05:00
|
|
|
unit_test(cmd_connect_with_server_when_provided),
|
|
|
|
unit_test(cmd_connect_with_port_when_provided),
|
|
|
|
unit_test(cmd_connect_with_server_and_port_when_provided),
|
2014-01-18 17:45:24 -05:00
|
|
|
unit_test(cmd_connect_shows_usage_when_server_provided_twice),
|
2014-01-18 17:50:17 -05:00
|
|
|
unit_test(cmd_connect_shows_usage_when_port_provided_twice),
|
2014-01-18 17:55:15 -05:00
|
|
|
unit_test(cmd_connect_shows_usage_when_invalid_first_property),
|
|
|
|
unit_test(cmd_connect_shows_usage_when_invalid_second_property),
|
2013-12-15 20:04:25 -05:00
|
|
|
|
|
|
|
unit_test(cmd_rooms_shows_message_when_disconnected),
|
|
|
|
unit_test(cmd_rooms_shows_message_when_disconnecting),
|
|
|
|
unit_test(cmd_rooms_shows_message_when_connecting),
|
|
|
|
unit_test(cmd_rooms_shows_message_when_started),
|
|
|
|
unit_test(cmd_rooms_shows_message_when_undefined),
|
|
|
|
unit_test(cmd_rooms_uses_account_default_when_no_arg),
|
|
|
|
unit_test(cmd_rooms_arg_used_when_passed),
|
|
|
|
|
|
|
|
unit_test(cmd_account_shows_usage_when_not_connected_and_no_args),
|
|
|
|
unit_test(cmd_account_shows_account_when_connected_and_no_args),
|
|
|
|
unit_test(cmd_account_list_shows_accounts),
|
|
|
|
unit_test(cmd_account_show_shows_usage_when_no_arg),
|
|
|
|
unit_test(cmd_account_show_shows_message_when_account_does_not_exist),
|
2013-12-19 16:05:39 -05:00
|
|
|
unit_test(cmd_account_show_shows_account_when_exists),
|
2013-12-15 20:04:25 -05:00
|
|
|
unit_test(cmd_account_add_shows_usage_when_no_arg),
|
|
|
|
unit_test(cmd_account_add_adds_account),
|
|
|
|
unit_test(cmd_account_add_shows_message),
|
|
|
|
unit_test(cmd_account_enable_shows_usage_when_no_arg),
|
|
|
|
unit_test(cmd_account_enable_enables_account),
|
|
|
|
unit_test(cmd_account_enable_shows_message_when_enabled),
|
|
|
|
unit_test(cmd_account_enable_shows_message_when_account_doesnt_exist),
|
|
|
|
unit_test(cmd_account_disable_shows_usage_when_no_arg),
|
|
|
|
unit_test(cmd_account_disable_disables_account),
|
|
|
|
unit_test(cmd_account_disable_shows_message_when_disabled),
|
|
|
|
unit_test(cmd_account_disable_shows_message_when_account_doesnt_exist),
|
|
|
|
unit_test(cmd_account_rename_shows_usage_when_no_args),
|
|
|
|
unit_test(cmd_account_rename_shows_usage_when_one_arg),
|
|
|
|
unit_test(cmd_account_rename_renames_account),
|
|
|
|
unit_test(cmd_account_rename_shows_message_when_renamed),
|
|
|
|
unit_test(cmd_account_rename_shows_message_when_not_renamed),
|
|
|
|
unit_test(cmd_account_set_shows_usage_when_no_args),
|
|
|
|
unit_test(cmd_account_set_shows_usage_when_one_arg),
|
|
|
|
unit_test(cmd_account_set_shows_usage_when_two_args),
|
|
|
|
unit_test(cmd_account_set_checks_account_exists),
|
|
|
|
unit_test(cmd_account_set_shows_message_when_account_doesnt_exist),
|
|
|
|
unit_test(cmd_account_set_jid_shows_message_for_malformed_jid),
|
|
|
|
unit_test(cmd_account_set_jid_sets_barejid),
|
|
|
|
unit_test(cmd_account_set_jid_sets_resource),
|
2013-12-17 17:33:49 -05:00
|
|
|
unit_test(cmd_account_set_server_sets_server),
|
|
|
|
unit_test(cmd_account_set_server_shows_message),
|
2013-12-17 17:37:35 -05:00
|
|
|
unit_test(cmd_account_set_resource_sets_resource),
|
|
|
|
unit_test(cmd_account_set_resource_shows_message),
|
2013-12-17 17:40:55 -05:00
|
|
|
unit_test(cmd_account_set_password_sets_password),
|
|
|
|
unit_test(cmd_account_set_password_shows_message),
|
2013-12-17 17:46:54 -05:00
|
|
|
unit_test(cmd_account_set_muc_sets_muc),
|
|
|
|
unit_test(cmd_account_set_muc_shows_message),
|
|
|
|
unit_test(cmd_account_set_nick_sets_nick),
|
|
|
|
unit_test(cmd_account_set_nick_shows_message),
|
2013-12-17 18:17:02 -05:00
|
|
|
unit_test(cmd_account_set_status_shows_message_when_invalid_status),
|
|
|
|
unit_test(cmd_account_set_status_sets_status_when_valid),
|
|
|
|
unit_test(cmd_account_set_status_sets_status_when_last),
|
|
|
|
unit_test(cmd_account_set_status_shows_message_when_set_valid),
|
|
|
|
unit_test(cmd_account_set_status_shows_message_when_set_last),
|
2013-12-17 18:23:11 -05:00
|
|
|
unit_test(cmd_account_set_invalid_presence_string_priority_shows_message),
|
|
|
|
unit_test(cmd_account_set_last_priority_shows_message),
|
2013-12-17 18:57:06 -05:00
|
|
|
unit_test(cmd_account_set_online_priority_sets_preference),
|
|
|
|
unit_test(cmd_account_set_chat_priority_sets_preference),
|
|
|
|
unit_test(cmd_account_set_away_priority_sets_preference),
|
|
|
|
unit_test(cmd_account_set_xa_priority_sets_preference),
|
|
|
|
unit_test(cmd_account_set_dnd_priority_sets_preference),
|
2013-12-26 10:17:46 -05:00
|
|
|
unit_test(cmd_account_set_online_priority_shows_message),
|
2013-12-26 19:29:20 -05:00
|
|
|
unit_test(cmd_account_set_priority_too_low_shows_message),
|
|
|
|
unit_test(cmd_account_set_priority_too_high_shows_message),
|
|
|
|
unit_test(cmd_account_set_priority_when_not_number_shows_message),
|
|
|
|
unit_test(cmd_account_set_priority_when_empty_shows_message),
|
2013-12-27 09:17:24 -05:00
|
|
|
unit_test(cmd_account_set_priority_updates_presence_when_account_connected_with_presence),
|
2013-12-27 09:35:31 -05:00
|
|
|
unit_test(cmd_account_clear_shows_usage_when_no_args),
|
|
|
|
unit_test(cmd_account_clear_shows_usage_when_one_arg),
|
|
|
|
unit_test(cmd_account_clear_checks_account_exists),
|
|
|
|
unit_test(cmd_account_clear_shows_message_when_account_doesnt_exist),
|
|
|
|
unit_test(cmd_account_clear_shows_message_when_invalid_property),
|
2013-12-27 12:25:30 -05:00
|
|
|
|
|
|
|
unit_test(cmd_sub_shows_message_when_not_connected),
|
2013-12-27 17:12:39 -05:00
|
|
|
unit_test(cmd_sub_shows_usage_when_no_arg),
|
2013-12-27 12:25:30 -05:00
|
|
|
|
2014-01-04 19:35:48 -05:00
|
|
|
unit_test(contact_in_group),
|
|
|
|
unit_test(contact_not_in_group),
|
|
|
|
unit_test(contact_name_when_name_exists),
|
|
|
|
unit_test(contact_jid_when_name_not_exists),
|
|
|
|
unit_test(contact_string_when_name_exists),
|
|
|
|
unit_test(contact_string_when_name_not_exists),
|
|
|
|
unit_test(contact_string_when_default_resource),
|
2014-01-04 19:43:37 -05:00
|
|
|
unit_test(contact_presence_offline),
|
2014-01-04 20:17:11 -05:00
|
|
|
unit_test(contact_presence_uses_highest_priority),
|
|
|
|
unit_test(contact_presence_chat_when_same_prioroty),
|
|
|
|
unit_test(contact_presence_online_when_same_prioroty),
|
|
|
|
unit_test(contact_presence_away_when_same_prioroty),
|
|
|
|
unit_test(contact_presence_xa_when_same_prioroty),
|
|
|
|
unit_test(contact_presence_dnd),
|
|
|
|
unit_test(contact_subscribed_when_to),
|
|
|
|
unit_test(contact_subscribed_when_both),
|
|
|
|
unit_test(contact_not_subscribed_when_from),
|
|
|
|
unit_test(contact_not_subscribed_when_no_subscription_value),
|
|
|
|
unit_test(contact_not_available),
|
|
|
|
unit_test(contact_not_available_when_highest_priority_away),
|
|
|
|
unit_test(contact_not_available_when_highest_priority_xa),
|
|
|
|
unit_test(contact_not_available_when_highest_priority_dnd),
|
|
|
|
unit_test(contact_available_when_highest_priority_online),
|
|
|
|
unit_test(contact_available_when_highest_priority_chat),
|
|
|
|
|
2014-01-18 20:25:04 -05:00
|
|
|
unit_test(cmd_statuses_shows_usage_when_bad_subcmd),
|
|
|
|
unit_test(cmd_statuses_shows_usage_when_bad_console_setting),
|
|
|
|
unit_test(cmd_statuses_shows_usage_when_bad_chat_setting),
|
|
|
|
unit_test(cmd_statuses_shows_usage_when_bad_muc_setting),
|
2014-01-19 11:17:34 -05:00
|
|
|
unit_test_setup_teardown(cmd_statuses_console_sets_all,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-19 11:17:34 -05:00
|
|
|
unit_test_setup_teardown(cmd_statuses_console_sets_online,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-19 11:17:34 -05:00
|
|
|
unit_test_setup_teardown(cmd_statuses_console_sets_none,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-19 11:17:34 -05:00
|
|
|
unit_test_setup_teardown(cmd_statuses_chat_sets_all,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-19 11:17:34 -05:00
|
|
|
unit_test_setup_teardown(cmd_statuses_chat_sets_online,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-19 11:17:34 -05:00
|
|
|
unit_test_setup_teardown(cmd_statuses_chat_sets_none,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-19 11:17:34 -05:00
|
|
|
unit_test_setup_teardown(cmd_statuses_muc_sets_on,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-19 11:17:34 -05:00
|
|
|
unit_test_setup_teardown(cmd_statuses_muc_sets_off,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-18 21:11:52 -05:00
|
|
|
|
2014-01-19 12:20:31 -05:00
|
|
|
unit_test_setup_teardown(statuses_console_defaults_to_all,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-19 12:20:31 -05:00
|
|
|
unit_test_setup_teardown(statuses_chat_defaults_to_all,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-19 12:20:31 -05:00
|
|
|
unit_test_setup_teardown(statuses_muc_defaults_to_on,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-19 12:20:31 -05:00
|
|
|
|
2014-01-20 13:40:48 -05:00
|
|
|
unit_test_setup_teardown(console_doesnt_show_online_presence_when_set_none,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-20 13:40:48 -05:00
|
|
|
unit_test_setup_teardown(console_shows_online_presence_when_set_online,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-20 13:40:48 -05:00
|
|
|
unit_test_setup_teardown(console_shows_online_presence_when_set_all,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-20 13:40:48 -05:00
|
|
|
unit_test_setup_teardown(console_doesnt_show_dnd_presence_when_set_none,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-20 13:40:48 -05:00
|
|
|
unit_test_setup_teardown(console_doesnt_show_dnd_presence_when_set_online,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-28 16:51:43 -05:00
|
|
|
unit_test_setup_teardown(console_shows_dnd_presence_when_set_all,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-30 18:15:39 -05:00
|
|
|
unit_test(handle_message_error_when_no_recipient),
|
|
|
|
unit_test_setup_teardown(handle_message_error_when_recipient_cancel,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 18:56:45 -05:00
|
|
|
close_preferences),
|
2014-01-30 18:15:39 -05:00
|
|
|
unit_test_setup_teardown(handle_message_error_when_recipient_cancel_disables_chat_session,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 18:56:45 -05:00
|
|
|
close_preferences),
|
2014-01-30 18:15:39 -05:00
|
|
|
unit_test(handle_message_error_when_recipient_and_no_type),
|
|
|
|
unit_test(handle_presence_error_when_no_recipient),
|
|
|
|
unit_test(handle_presence_error_when_no_recipient_and_conflict),
|
|
|
|
unit_test(handle_presence_error_when_nick_conflict_shows_recipient_error),
|
|
|
|
unit_test(handle_presence_error_when_nick_conflict_does_not_join_room),
|
|
|
|
unit_test(handle_presence_error_when_from_recipient_not_conflict),
|
2014-01-20 13:40:48 -05:00
|
|
|
|
2014-01-23 17:29:53 -05:00
|
|
|
unit_test(cmd_alias_add_shows_usage_when_no_args),
|
|
|
|
unit_test(cmd_alias_add_shows_usage_when_no_value),
|
|
|
|
unit_test(cmd_alias_remove_shows_usage_when_no_args),
|
|
|
|
unit_test(cmd_alias_show_usage_when_invalid_subcmd),
|
|
|
|
unit_test_setup_teardown(cmd_alias_add_adds_alias,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-28 16:51:43 -05:00
|
|
|
unit_test_setup_teardown(cmd_alias_add_shows_message_when_exists,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-23 17:29:53 -05:00
|
|
|
unit_test_setup_teardown(cmd_alias_remove_removes_alias,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-23 17:29:53 -05:00
|
|
|
unit_test_setup_teardown(cmd_alias_remove_shows_message_when_no_alias,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-23 17:29:53 -05:00
|
|
|
unit_test_setup_teardown(cmd_alias_list_shows_all_aliases,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-01-28 17:05:27 -05:00
|
|
|
close_preferences),
|
2014-01-23 17:29:53 -05:00
|
|
|
|
2014-01-30 18:41:18 -05:00
|
|
|
unit_test_setup_teardown(test_muc_add_invite, muc_before_test, muc_after_test),
|
|
|
|
unit_test_setup_teardown(test_muc_remove_invite, muc_before_test, muc_after_test),
|
2014-01-30 18:49:58 -05:00
|
|
|
unit_test_setup_teardown(test_muc_invite_count_0, muc_before_test, muc_after_test),
|
|
|
|
unit_test_setup_teardown(test_muc_invite_count_5, muc_before_test, muc_after_test),
|
2014-01-30 19:10:28 -05:00
|
|
|
unit_test_setup_teardown(test_muc_room_is_not_active, muc_before_test, muc_after_test),
|
|
|
|
unit_test_setup_teardown(test_muc_room_is_active, muc_before_test, muc_after_test),
|
2014-01-30 18:32:52 -05:00
|
|
|
|
2014-02-01 11:24:51 -05:00
|
|
|
unit_test(cmd_bookmark_shows_message_when_disconnected),
|
|
|
|
unit_test(cmd_bookmark_shows_message_when_disconnecting),
|
|
|
|
unit_test(cmd_bookmark_shows_message_when_connecting),
|
|
|
|
unit_test(cmd_bookmark_shows_message_when_started),
|
|
|
|
unit_test(cmd_bookmark_shows_message_when_undefined),
|
2014-02-01 11:16:56 -05:00
|
|
|
unit_test(cmd_bookmark_shows_usage_when_no_args),
|
2014-02-01 16:18:15 -05:00
|
|
|
unit_test(cmd_bookmark_list_shows_bookmarks),
|
2014-02-01 18:48:24 -05:00
|
|
|
unit_test(cmd_bookmark_add_shows_usage_when_no_args_not_muc),
|
|
|
|
unit_test(cmd_bookmark_remove_shows_message_when_no_args_not_muc),
|
|
|
|
unit_test(cmd_bookmark_add_adds_bookmark_with_jid),
|
|
|
|
unit_test(cmd_bookmark_add_adds_bookmark_with_jid_nick),
|
2014-02-01 19:22:53 -05:00
|
|
|
unit_test(cmd_bookmark_add_adds_bookmark_with_jid_autojoin),
|
2014-02-01 18:48:24 -05:00
|
|
|
unit_test(cmd_bookmark_add_adds_bookmark_with_jid_nick_autojoin),
|
|
|
|
unit_test(cmd_bookmark_add_adds_bookmark_with_room_details),
|
|
|
|
unit_test(cmd_bookmark_add_adds_bookmark_with_room_details_autojoin),
|
2014-02-01 19:37:37 -05:00
|
|
|
unit_test(cmd_bookmark_remove_removes_bookmark),
|
|
|
|
unit_test(cmd_bookmark_remove_removes_autojoin),
|
2014-02-01 19:49:02 -05:00
|
|
|
unit_test(cmd_bookmark_add_shows_message_when_upated),
|
2014-02-01 19:59:32 -05:00
|
|
|
unit_test(cmd_bookmark_remove_shows_message_when_no_bookmark),
|
2014-02-01 20:05:52 -05:00
|
|
|
unit_test(cmd_bookmark_remove_autojoin_shows_message_when_no_bookmark),
|
2014-02-15 19:04:53 -05:00
|
|
|
|
|
|
|
#ifdef HAVE_LIBOTR
|
|
|
|
unit_test(cmd_otr_shows_usage_when_no_args),
|
2014-02-15 20:32:37 -05:00
|
|
|
unit_test(cmd_otr_shows_usage_when_invalid_subcommand),
|
|
|
|
unit_test(cmd_otr_log_shows_usage_when_no_args),
|
|
|
|
unit_test(cmd_otr_log_shows_usage_when_invalid_subcommand),
|
|
|
|
unit_test_setup_teardown(cmd_otr_log_on_enables_logging,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-02-15 20:32:37 -05:00
|
|
|
close_preferences),
|
|
|
|
unit_test_setup_teardown(cmd_otr_log_off_disables_logging,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-02-15 20:32:37 -05:00
|
|
|
close_preferences),
|
|
|
|
unit_test_setup_teardown(cmd_otr_redact_redacts_logging,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-02-15 20:32:37 -05:00
|
|
|
close_preferences),
|
|
|
|
unit_test_setup_teardown(cmd_otr_log_on_shows_warning_when_chlog_disabled,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-02-15 20:32:37 -05:00
|
|
|
close_preferences),
|
|
|
|
unit_test_setup_teardown(cmd_otr_log_redact_shows_warning_when_chlog_disabled,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-02-15 20:32:37 -05:00
|
|
|
close_preferences),
|
2014-02-15 21:22:29 -05:00
|
|
|
unit_test(cmd_otr_warn_shows_usage_when_no_args),
|
|
|
|
unit_test(cmd_otr_warn_shows_usage_when_invalid_arg),
|
|
|
|
unit_test_setup_teardown(cmd_otr_warn_on_enables_unencrypted_warning,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-02-15 21:22:29 -05:00
|
|
|
close_preferences),
|
|
|
|
unit_test_setup_teardown(cmd_otr_warn_off_disables_unencrypted_warning,
|
2014-02-16 13:07:41 -05:00
|
|
|
load_preferences,
|
2014-02-15 21:22:29 -05:00
|
|
|
close_preferences),
|
2014-02-16 09:44:40 -05:00
|
|
|
unit_test(cmd_otr_libver_shows_libotr_version),
|
2014-02-16 14:20:55 -05:00
|
|
|
unit_test(cmd_otr_gen_shows_message_when_not_connected),
|
2014-02-16 14:35:40 -05:00
|
|
|
unit_test(cmd_otr_gen_generates_key_for_connected_account),
|
2014-02-16 15:09:12 -05:00
|
|
|
unit_test(cmd_otr_gen_shows_message_when_disconnected),
|
|
|
|
unit_test(cmd_otr_gen_shows_message_when_undefined),
|
|
|
|
unit_test(cmd_otr_gen_shows_message_when_started),
|
|
|
|
unit_test(cmd_otr_gen_shows_message_when_connecting),
|
|
|
|
unit_test(cmd_otr_gen_shows_message_when_disconnecting),
|
2014-02-16 15:15:10 -05:00
|
|
|
unit_test(cmd_otr_myfp_shows_message_when_disconnected),
|
|
|
|
unit_test(cmd_otr_myfp_shows_message_when_undefined),
|
|
|
|
unit_test(cmd_otr_myfp_shows_message_when_started),
|
|
|
|
unit_test(cmd_otr_myfp_shows_message_when_connecting),
|
|
|
|
unit_test(cmd_otr_myfp_shows_message_when_disconnecting),
|
2014-02-23 15:34:27 -05:00
|
|
|
unit_test(cmd_otr_myfp_shows_message_when_no_key),
|
2014-02-17 16:52:42 -05:00
|
|
|
unit_test(cmd_otr_myfp_shows_my_fingerprint),
|
2014-02-17 17:14:33 -05:00
|
|
|
unit_test(cmd_otr_theirfp_shows_message_when_in_console),
|
2014-02-17 17:44:27 -05:00
|
|
|
unit_test(cmd_otr_theirfp_shows_message_when_in_muc),
|
|
|
|
unit_test(cmd_otr_theirfp_shows_message_when_in_private),
|
|
|
|
unit_test(cmd_otr_theirfp_shows_message_when_in_duck),
|
2014-02-17 17:57:36 -05:00
|
|
|
unit_test(cmd_otr_theirfp_shows_message_when_non_otr_chat_window),
|
2014-02-17 18:10:00 -05:00
|
|
|
unit_test(cmd_otr_theirfp_shows_fingerprint),
|
2014-02-23 15:09:00 -05:00
|
|
|
unit_test(cmd_otr_start_shows_message_when_in_console),
|
|
|
|
unit_test(cmd_otr_start_shows_message_when_in_muc),
|
|
|
|
unit_test(cmd_otr_start_shows_message_when_in_private),
|
|
|
|
unit_test(cmd_otr_start_shows_message_when_in_duck),
|
2014-02-23 15:17:45 -05:00
|
|
|
unit_test(cmd_otr_start_shows_message_when_already_started),
|
2014-02-23 16:02:02 -05:00
|
|
|
unit_test(cmd_otr_start_shows_message_when_no_key),
|
2014-02-23 16:20:41 -05:00
|
|
|
unit_test(cmd_otr_start_sends_otr_query_message_to_current_recipeint),
|
2014-02-15 19:04:53 -05:00
|
|
|
#else
|
|
|
|
unit_test(cmd_otr_shows_message_when_otr_unsupported),
|
|
|
|
#endif
|
2014-03-07 19:07:38 -05:00
|
|
|
unit_test(cmd_join_shows_message_when_disconnecting),
|
|
|
|
unit_test(cmd_join_shows_message_when_connecting),
|
|
|
|
unit_test(cmd_join_shows_message_when_disconnected),
|
|
|
|
unit_test(cmd_join_shows_message_when_undefined),
|
2014-03-07 19:19:21 -05:00
|
|
|
unit_test(cmd_join_shows_usage_when_no_args),
|
2014-03-07 19:23:52 -05:00
|
|
|
unit_test(cmd_join_shows_error_message_when_invalid_room_jid),
|
2014-03-08 16:45:07 -05:00
|
|
|
unit_test(cmd_join_uses_account_mucservice_when_no_service_specified),
|
2014-03-08 16:10:23 -05:00
|
|
|
unit_test(cmd_join_uses_supplied_nick),
|
2014-03-08 16:37:06 -05:00
|
|
|
unit_test(cmd_join_uses_account_nick_when_not_supplied),
|
2014-03-08 16:50:55 -05:00
|
|
|
unit_test(cmd_join_uses_password_when_supplied),
|
2014-02-01 11:16:56 -05:00
|
|
|
};
|
|
|
|
|
2014-02-12 15:49:50 -05:00
|
|
|
return run_tests(all_tests);
|
2012-03-01 20:51:40 -05:00
|
|
|
}
|