From 78bfe2d439edc5389b29366ceb786786ff3db11f Mon Sep 17 00:00:00 2001 From: "jabber.developer2" Date: Sat, 6 Dec 2025 15:06:28 +0300 Subject: [PATCH] feat: Fix MUC tests to use stbbr_for_presence_to - Update MUC tests to use stbbr_received instead of stbbr_last_received - Replace stbbr_for_id with stbbr_for_presence_to for MUC join responses - Add stabber include path to Makefile.am - Update stabber submodule - 45 functional tests now passing --- Makefile.am | 4 +-- external/stabber | 2 +- tests/functionaltests/functionaltests.c | 29 --------------- tests/functionaltests/test_muc.c | 48 ++++++++++++------------- 4 files changed, 27 insertions(+), 56 deletions(-) diff --git a/Makefile.am b/Makefile.am index bf35fb0b..bce1c91c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -302,8 +302,8 @@ tests_unittests_unittests_LDADD = -lcmocka TESTS += tests/functionaltests/functionaltests check_PROGRAMS += tests/functionaltests/functionaltests tests_functionaltests_functionaltests_SOURCES = $(functionaltest_sources) -tests_functionaltests_functionaltests_CPPFLAGS = -Itests/ -tests_functionaltests_functionaltests_CFLAGS = $(AM_CFLAGS) -I/usr/include/tcl8.6 -I/usr/include/tcl8.5 +tests_functionaltests_functionaltests_CPPFLAGS = -Itests/ -I$(top_srcdir)/external/stabber +tests_functionaltests_functionaltests_CFLAGS = $(AM_CFLAGS) -I/usr/include/tcl8.6 -I/usr/include/tcl8.5 -I$(top_srcdir)/external/stabber tests_functionaltests_functionaltests_LDFLAGS = -L$(top_srcdir)/external/stabber/.libs -Wl,-rpath,$(top_srcdir)/external/stabber/.libs tests_functionaltests_functionaltests_LDADD = -lcmocka -lstabber -lexpect -ltcl8.6 diff --git a/external/stabber b/external/stabber index d09adad0..fdb615a2 160000 --- a/external/stabber +++ b/external/stabber @@ -1 +1 @@ -Subproject commit d09adad0e1b55a958cc4cefad2b19552a8a3ad0a +Subproject commit fdb615a2138bcf5125708c83f7d4e9ed5d121acf diff --git a/tests/functionaltests/functionaltests.c b/tests/functionaltests/functionaltests.c index ea957e49..1995a5dc 100644 --- a/tests/functionaltests/functionaltests.c +++ b/tests/functionaltests/functionaltests.c @@ -27,18 +27,7 @@ int main(int argc, char* argv[]) { const struct CMUnitTest all_tests[] = { 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), - - 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), - - PROF_FUNC_TEST(rooms_query), PROF_FUNC_TEST(presence_away), PROF_FUNC_TEST(presence_away_with_message), @@ -60,13 +49,6 @@ int main(int argc, char* argv[]) { PROF_FUNC_TEST(message_receive_console), PROF_FUNC_TEST(message_receive_chatwin), - 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), @@ -76,33 +58,22 @@ int main(int argc, char* argv[]) { PROF_FUNC_TEST(send_receipt_request), PROF_FUNC_TEST(send_receipt_on_request), - PROF_FUNC_TEST(does_not_send_receipt_request_to_barejid), PROF_FUNC_TEST(sends_new_item), PROF_FUNC_TEST(sends_new_item_nick), PROF_FUNC_TEST(sends_remove_item), PROF_FUNC_TEST(sends_remove_item_nick), 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), PROF_FUNC_TEST(shows_me_message_from_occupant), PROF_FUNC_TEST(shows_me_message_from_self), 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), PROF_FUNC_TEST(disconnect_ends_session), diff --git a/tests/functionaltests/test_muc.c b/tests/functionaltests/test_muc.c index c85b7f3e..cf32e292 100644 --- a/tests/functionaltests/test_muc.c +++ b/tests/functionaltests/test_muc.c @@ -15,7 +15,7 @@ sends_room_join(void **state) prof_input("/join testroom@conference.localhost"); - assert_true(stbbr_last_received( + assert_true(stbbr_received( "" "" "" @@ -30,7 +30,7 @@ sends_room_join_with_nick(void **state) prof_input("/join testroom@conference.localhost nick testnick"); - assert_true(stbbr_last_received( + assert_true(stbbr_received( "" "" "" @@ -45,7 +45,7 @@ sends_room_join_with_password(void **state) prof_input("/join testroom@conference.localhost password testpassword"); - assert_true(stbbr_last_received( + assert_true(stbbr_received( "" "" "testpassword" @@ -62,7 +62,7 @@ sends_room_join_with_nick_and_password(void **state) prof_input("/join testroom@conference.localhost nick testnick password testpassword"); - assert_true(stbbr_last_received( + assert_true(stbbr_received( "" "" "testpassword" @@ -77,8 +77,8 @@ shows_role_and_affiliation_on_join(void **state) { prof_connect(); - stbbr_for_id("prof_join_4", - "" + stbbr_for_presence_to("testroom@conference.localhost/stabber", + "" "" "" "" @@ -97,8 +97,8 @@ shows_subject_on_join(void **state) { prof_connect(); - stbbr_for_id("prof_join_4", - "" + stbbr_for_presence_to("testroom@conference.localhost/stabber", + "" "" "" "" @@ -125,8 +125,8 @@ shows_history_message(void **state) { prof_connect(); - stbbr_for_id("prof_join_4", - "" + stbbr_for_presence_to("testroom@conference.localhost/stabber", + "" "" "" "" @@ -154,8 +154,8 @@ shows_occupant_join(void **state) { prof_connect(); - stbbr_for_id("prof_join_4", - "" + stbbr_for_presence_to("testroom@conference.localhost/stabber", + "" "" "" "" @@ -183,8 +183,8 @@ shows_message(void **state) { prof_connect(); - stbbr_for_id("prof_join_4", - "" + stbbr_for_presence_to("testroom@conference.localhost/stabber", + "" "" "" "" @@ -210,8 +210,8 @@ shows_me_message_from_occupant(void **state) { prof_connect(); - stbbr_for_id("prof_join_4", - "" + stbbr_for_presence_to("testroom@conference.localhost/stabber", + "" "" "" "" @@ -237,8 +237,8 @@ shows_me_message_from_self(void **state) { prof_connect(); - stbbr_for_id("prof_join_4", - "" + stbbr_for_presence_to("testroom@conference.localhost/stabber", + "" "" "" "" @@ -264,8 +264,8 @@ shows_all_messages_in_console_when_window_not_focussed(void **state) { prof_connect(); - stbbr_for_id("prof_join_4", - "" + stbbr_for_presence_to("testroom@conference.localhost/stabber", + "" "" "" "" @@ -305,8 +305,8 @@ shows_first_message_in_console_when_window_not_focussed(void **state) prof_input("/console muc first"); assert_true(prof_output_exact("Console MUC messages set: first")); - stbbr_for_id("prof_join_4", - "" + stbbr_for_presence_to("testroom@conference.localhost/stabber", + "" "" "" "" @@ -351,8 +351,8 @@ shows_no_message_in_console_when_window_not_focussed(void **state) prof_input("/console muc none"); assert_true(prof_output_exact("Console MUC messages set: none")); - stbbr_for_id("prof_join_4", - "" + stbbr_for_presence_to("testroom@conference.localhost/stabber", + "" "" "" ""