From 52e2917b5d2443ce152da3d768cd2cb8e52c5efe Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 20 Jul 2015 22:00:51 +0100 Subject: [PATCH] Added functional test macro --- tests/functionaltests/functionaltests.c | 138 +++++++----------------- 1 file changed, 36 insertions(+), 102 deletions(-) diff --git a/tests/functionaltests/functionaltests.c b/tests/functionaltests/functionaltests.c index b665ad4b..ecdfaa01 100644 --- a/tests/functionaltests/functionaltests.c +++ b/tests/functionaltests/functionaltests.c @@ -18,118 +18,52 @@ #include "test_carbons.h" #include "test_chat_session.h" +#define PROF_FUNC_TEST(test) unit_test_setup_teardown(test, init_prof_test, close_prof_test) + int main(int argc, char* argv[]) { const UnitTest all_tests[] = { - unit_test_setup_teardown(connect_jid_requests_roster, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(connect_jid_sends_presence_after_receiving_roster, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(connect_jid_requests_bookmarks, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(connect_bad_password, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(connect_shows_presence_updates, - init_prof_test, - close_prof_test), + 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), - unit_test_setup_teardown(ping_multiple, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(ping_responds, - init_prof_test, - close_prof_test), + PROF_FUNC_TEST(ping_multiple), + PROF_FUNC_TEST(ping_responds), - unit_test_setup_teardown(rooms_query, - init_prof_test, - close_prof_test), + PROF_FUNC_TEST(rooms_query), - unit_test_setup_teardown(presence_away, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_away_with_message, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_online, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_online_with_message, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_xa, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_xa_with_message, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_dnd, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_dnd_with_message, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_chat, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_chat_with_message, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_set_priority, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_includes_priority, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(presence_received, - init_prof_test, - close_prof_test), + 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), + PROF_FUNC_TEST(presence_received), - unit_test_setup_teardown(message_send, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(message_receive, - init_prof_test, - close_prof_test), + PROF_FUNC_TEST(message_send), + PROF_FUNC_TEST(message_receive), - unit_test_setup_teardown(sends_message_to_barejid_when_contact_offline, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(sends_message_to_barejid_when_contact_online, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(sends_message_to_fulljid_when_received_from_fulljid, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(sends_subsequent_messages_to_fulljid, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(resets_to_barejid_after_presence_received, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(new_session_when_message_received_from_different_fulljid, - init_prof_test, - close_prof_test), + 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), - unit_test_setup_teardown(send_enable_carbons, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(connect_with_carbons_enabled, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(send_disable_carbons, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(receive_carbon, - init_prof_test, - close_prof_test), - unit_test_setup_teardown(receive_self_carbon, - init_prof_test, - close_prof_test), + 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) }; return run_tests(all_tests);