tests: add autoping, helpers and XEP functional tests
All checks were successful
CI Code / Check spelling (pull_request) Successful in 20s
CI Code / Check coding style (pull_request) Successful in 35s
CI Code / Code Coverage (pull_request) Successful in 4m54s
CI Code / Linux (ubuntu) (pull_request) Successful in 6m23s
CI Code / Linux (debian) (pull_request) Successful in 9m12s
CI Code / Linux (arch) (pull_request) Successful in 11m12s

- Add 15 unit tests for autoping logic (XEP-0199)
- Add 10 helper tests for refactoring validation
- Add Last Activity functional tests (XEP-0012)
- Add MUC affiliation/kick tests (XEP-0045)
This commit is contained in:
2026-02-05 00:01:16 +03:00
parent 58dd89be40
commit 6f136bde88
11 changed files with 942 additions and 0 deletions

View File

@@ -52,6 +52,7 @@
#include "test_software.h"
#include "test_muc.h"
#include "test_disconnect.h"
#include "test_lastactivity.h"
/* Macro to wrap each test with setup/teardown functions */
#define PROF_FUNC_TEST(test) cmocka_unit_test_setup_teardown(test, init_prof_test, close_prof_test)
@@ -104,6 +105,10 @@ main(int argc, char* argv[])
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),
/* Last Activity - XEP-0012 */
PROF_FUNC_TEST(responds_to_last_activity_request),
PROF_FUNC_TEST(last_activity_request_to_contact),
};
/* ============================================================
@@ -188,6 +193,10 @@ main(int argc, char* argv[])
PROF_FUNC_TEST(shows_first_message_in_console_when_window_not_focussed),
PROF_FUNC_TEST(shows_no_message_in_console_when_window_not_focussed),
/* MUC moderation - XEP-0045 room admin */
PROF_FUNC_TEST(sends_affiliation_list_request),
PROF_FUNC_TEST(sends_kick_request),
/* Message Carbons - XEP-0280 (message sync across devices) */
PROF_FUNC_TEST(send_enable_carbons),
PROF_FUNC_TEST(connect_with_carbons_enabled),