test: add functional tests for autoping (XEP-0199)
- autoping_set_interval: verify /autoping set command - autoping_set_zero_disables: verify disabling autoping - autoping_timeout_set: verify /autoping timeout command - autoping_timeout_zero_disables: verify disabling timeout - autoping_sends_ping_after_interval: verify automatic ping IQ - autoping_server_not_supporting_ping: verify error handling Fast tests (command parsing) in Group 1, slow tests (timer-based) in Group 3.
This commit is contained in:
@@ -15,9 +15,9 @@
|
||||
* functional tests run less frequently than unit tests.
|
||||
*
|
||||
* Tests are organized into groups for better maintainability and parallel execution:
|
||||
* Group 1: Connect, Ping, Rooms, Software
|
||||
* Group 1: Connect, Ping, Autoping (fast), Rooms, Software, Last Activity
|
||||
* Group 2: Message, Receipts, Roster, Chat Session
|
||||
* Group 3: Presence, Disconnect
|
||||
* Group 3: Presence, Disconnect, Autoping (slow)
|
||||
* Group 4: MUC, Carbons
|
||||
*
|
||||
* Parallel execution:
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "test_muc.h"
|
||||
#include "test_disconnect.h"
|
||||
#include "test_lastactivity.h"
|
||||
#include "test_autoping.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)
|
||||
@@ -95,6 +96,12 @@ main(int argc, char* argv[])
|
||||
PROF_FUNC_TEST(ping_jid),
|
||||
PROF_FUNC_TEST(ping_jid_not_supported),
|
||||
|
||||
/* Autoping command tests - fast, no waiting */
|
||||
PROF_FUNC_TEST(autoping_set_interval),
|
||||
PROF_FUNC_TEST(autoping_set_zero_disables),
|
||||
PROF_FUNC_TEST(autoping_timeout_set),
|
||||
PROF_FUNC_TEST(autoping_timeout_zero_disables),
|
||||
|
||||
/* Room discovery - XEP-0045 */
|
||||
PROF_FUNC_TEST(rooms_query),
|
||||
|
||||
@@ -165,6 +172,10 @@ main(int argc, char* argv[])
|
||||
|
||||
/* Disconnect - clean session termination */
|
||||
PROF_FUNC_TEST(disconnect_ends_session),
|
||||
|
||||
/* Autoping slow tests - require sleep for timer triggers */
|
||||
PROF_FUNC_TEST(autoping_sends_ping_after_interval),
|
||||
PROF_FUNC_TEST(autoping_server_not_supporting_ping),
|
||||
};
|
||||
|
||||
/* ============================================================
|
||||
|
||||
Reference in New Issue
Block a user