2015-05-16 20:11:03 -04:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <setjmp.h>
|
|
|
|
#include <cmocka.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2016-03-31 16:05:02 -04:00
|
|
|
#include "config.h"
|
2015-05-16 20:11:03 -04:00
|
|
|
|
|
|
|
#include "proftest.h"
|
|
|
|
#include "test_connect.h"
|
2015-05-28 15:02:16 -04:00
|
|
|
#include "test_ping.h"
|
|
|
|
#include "test_rooms.h"
|
2015-05-28 20:01:34 -04:00
|
|
|
#include "test_presence.h"
|
2015-05-30 19:12:13 -04:00
|
|
|
#include "test_message.h"
|
2015-07-05 12:29:33 -04:00
|
|
|
#include "test_carbons.h"
|
2015-06-05 20:02:27 -04:00
|
|
|
#include "test_chat_session.h"
|
2015-07-20 17:18:50 -04:00
|
|
|
#include "test_receipts.h"
|
2015-07-22 17:48:37 -04:00
|
|
|
#include "test_roster.h"
|
2015-08-04 18:43:19 -04:00
|
|
|
#include "test_software.h"
|
2015-12-19 21:13:01 -05:00
|
|
|
#include "test_muc.h"
|
2016-01-04 20:30:32 -05:00
|
|
|
#include "test_disconnect.h"
|
2015-05-16 20:11:03 -04:00
|
|
|
|
2015-07-20 17:00:51 -04:00
|
|
|
#define PROF_FUNC_TEST(test) unit_test_setup_teardown(test, init_prof_test, close_prof_test)
|
|
|
|
|
2015-05-16 20:11:03 -04:00
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
|
|
|
|
const UnitTest all_tests[] = {
|
2015-05-24 15:31:18 -04:00
|
|
|
|
2015-12-21 19:45:15 -05:00
|
|
|
PROF_FUNC_TEST(connect_jid_requests_roster),
|
|
|
|
PROF_FUNC_TEST(connect_jid_sends_presence_after_receiving_roster),
|
|
|
|
PROF_FUNC_TEST(connect_jid_requests_bookmarks),
|
|
|
|
PROF_FUNC_TEST(connect_bad_password),
|
|
|
|
PROF_FUNC_TEST(connect_shows_presence_updates),
|
|
|
|
|
2017-06-15 19:59:21 -04:00
|
|
|
PROF_FUNC_TEST(ping_server),
|
|
|
|
PROF_FUNC_TEST(ping_server_not_supported),
|
|
|
|
PROF_FUNC_TEST(ping_responds_to_server_request),
|
|
|
|
PROF_FUNC_TEST(ping_jid),
|
|
|
|
PROF_FUNC_TEST(ping_jid_not_supported),
|
2015-12-21 19:45:15 -05:00
|
|
|
|
|
|
|
PROF_FUNC_TEST(rooms_query),
|
|
|
|
|
|
|
|
PROF_FUNC_TEST(presence_away),
|
|
|
|
PROF_FUNC_TEST(presence_away_with_message),
|
|
|
|
PROF_FUNC_TEST(presence_online),
|
|
|
|
PROF_FUNC_TEST(presence_online_with_message),
|
|
|
|
PROF_FUNC_TEST(presence_xa),
|
|
|
|
PROF_FUNC_TEST(presence_xa_with_message),
|
|
|
|
PROF_FUNC_TEST(presence_dnd),
|
|
|
|
PROF_FUNC_TEST(presence_dnd_with_message),
|
|
|
|
PROF_FUNC_TEST(presence_chat),
|
|
|
|
PROF_FUNC_TEST(presence_chat_with_message),
|
|
|
|
PROF_FUNC_TEST(presence_set_priority),
|
|
|
|
PROF_FUNC_TEST(presence_includes_priority),
|
2017-01-15 18:59:31 -05:00
|
|
|
PROF_FUNC_TEST(presence_keeps_status),
|
2015-12-21 19:45:15 -05:00
|
|
|
PROF_FUNC_TEST(presence_received),
|
|
|
|
PROF_FUNC_TEST(presence_missing_resource_defaults),
|
2015-05-30 19:12:13 -04:00
|
|
|
|
2015-07-20 17:00:51 -04:00
|
|
|
PROF_FUNC_TEST(message_send),
|
2015-12-21 19:27:37 -05:00
|
|
|
PROF_FUNC_TEST(message_receive_console),
|
|
|
|
PROF_FUNC_TEST(message_receive_chatwin),
|
|
|
|
|
2015-12-21 19:45:15 -05:00
|
|
|
PROF_FUNC_TEST(sends_message_to_barejid_when_contact_offline),
|
|
|
|
PROF_FUNC_TEST(sends_message_to_barejid_when_contact_online),
|
|
|
|
PROF_FUNC_TEST(sends_message_to_fulljid_when_received_from_fulljid),
|
|
|
|
PROF_FUNC_TEST(sends_subsequent_messages_to_fulljid),
|
|
|
|
PROF_FUNC_TEST(resets_to_barejid_after_presence_received),
|
|
|
|
PROF_FUNC_TEST(new_session_when_message_received_from_different_fulljid),
|
|
|
|
|
|
|
|
PROF_FUNC_TEST(send_enable_carbons),
|
|
|
|
PROF_FUNC_TEST(connect_with_carbons_enabled),
|
|
|
|
PROF_FUNC_TEST(send_disable_carbons),
|
|
|
|
PROF_FUNC_TEST(receive_carbon),
|
|
|
|
PROF_FUNC_TEST(receive_self_carbon),
|
2016-08-28 12:27:26 -04:00
|
|
|
PROF_FUNC_TEST(receive_private_carbon),
|
2015-12-21 19:45:15 -05:00
|
|
|
|
|
|
|
PROF_FUNC_TEST(send_receipt_request),
|
|
|
|
PROF_FUNC_TEST(send_receipt_on_request),
|
2016-08-18 17:51:06 -04:00
|
|
|
PROF_FUNC_TEST(does_not_send_receipt_request_to_barejid),
|
2015-12-21 19:45:15 -05:00
|
|
|
PROF_FUNC_TEST(sends_new_item),
|
|
|
|
PROF_FUNC_TEST(sends_new_item_nick),
|
|
|
|
PROF_FUNC_TEST(sends_remove_item),
|
2023-04-13 09:23:45 -04:00
|
|
|
PROF_FUNC_TEST(sends_remove_item_nick),
|
2015-12-21 19:45:15 -05:00
|
|
|
PROF_FUNC_TEST(sends_nick_change),
|
|
|
|
|
|
|
|
PROF_FUNC_TEST(send_software_version_request),
|
|
|
|
PROF_FUNC_TEST(display_software_version_result),
|
|
|
|
PROF_FUNC_TEST(shows_message_when_software_version_error),
|
|
|
|
PROF_FUNC_TEST(display_software_version_result_when_from_domainpart),
|
|
|
|
PROF_FUNC_TEST(show_message_in_chat_window_when_no_resource),
|
|
|
|
PROF_FUNC_TEST(display_software_version_result_in_chat),
|
|
|
|
|
|
|
|
PROF_FUNC_TEST(sends_room_join),
|
|
|
|
PROF_FUNC_TEST(sends_room_join_with_nick),
|
|
|
|
PROF_FUNC_TEST(sends_room_join_with_password),
|
|
|
|
PROF_FUNC_TEST(sends_room_join_with_nick_and_password),
|
|
|
|
PROF_FUNC_TEST(shows_role_and_affiliation_on_join),
|
|
|
|
PROF_FUNC_TEST(shows_subject_on_join),
|
|
|
|
PROF_FUNC_TEST(shows_history_message),
|
|
|
|
PROF_FUNC_TEST(shows_occupant_join),
|
|
|
|
PROF_FUNC_TEST(shows_message),
|
2018-04-21 15:39:18 -04:00
|
|
|
PROF_FUNC_TEST(shows_me_message_from_occupant),
|
|
|
|
PROF_FUNC_TEST(shows_me_message_from_self),
|
2015-12-29 19:32:52 -05:00
|
|
|
PROF_FUNC_TEST(shows_all_messages_in_console_when_window_not_focussed),
|
|
|
|
PROF_FUNC_TEST(shows_first_message_in_console_when_window_not_focussed),
|
|
|
|
PROF_FUNC_TEST(shows_no_message_in_console_when_window_not_focussed),
|
2016-01-04 20:30:32 -05:00
|
|
|
|
|
|
|
PROF_FUNC_TEST(disconnect_ends_session),
|
2015-05-16 20:11:03 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
return run_tests(all_tests);
|
|
|
|
}
|