refactor(tests): improve functional test documentation and cleanup
Some checks failed
CI Code / Check spelling (pull_request) Successful in 21s
CI Code / Check coding style (pull_request) Successful in 37s
CI Code / Linux (arch) (pull_request) Failing after 22m22s
CI Code / Linux (debian) (pull_request) Successful in 1h8m49s
CI Code / Linux (ubuntu) (pull_request) Failing after 25m28s
Some checks failed
CI Code / Check spelling (pull_request) Successful in 21s
CI Code / Check coding style (pull_request) Successful in 37s
CI Code / Linux (arch) (pull_request) Failing after 22m22s
CI Code / Linux (debian) (pull_request) Successful in 1h8m49s
CI Code / Linux (ubuntu) (pull_request) Failing after 25m28s
- Add detailed documentation about test isolation in functionaltests.c - Improve comments in proftest.c: buffer size explanation, stabber sync TODO - Add reference to stabber issue #1 for stbbr_wait_stopped() API - Document prof_output_regex() usage rationale in test_muc.c - Enhance ping_server test comments for clarity - Update CONTRIBUTING.md: fix function names (prof_output_regex, prof_timeout) - Remove redundant commented-out test configurations from ci-build.sh - Remove obsolete stabber recv suppressions from prof.supp (issue fixed) - Add clear explanation for disabled assertion in test_chat_session.c - Add comment explaining /connect max args in cmd_defs.c
This commit is contained in:
@@ -11,8 +11,13 @@
|
||||
void
|
||||
ping_server(void **state)
|
||||
{
|
||||
// This test verifies that profanity correctly handles the /ping command
|
||||
// when the server supports ping (urn:xmpp:ping feature)
|
||||
/*
|
||||
* This test verifies that profanity correctly handles the /ping command
|
||||
* when the server supports ping (urn:xmpp:ping feature).
|
||||
*
|
||||
* We register disco#info response with ping support, then verify
|
||||
* profanity sends ping and receives "Pinged server" confirmation.
|
||||
*/
|
||||
|
||||
// Register disco#info response that includes ping support
|
||||
stbbr_for_query("http://jabber.org/protocol/disco#info",
|
||||
@@ -31,15 +36,18 @@ ping_server(void **state)
|
||||
|
||||
prof_connect();
|
||||
|
||||
// Wait for disco#info exchange to complete
|
||||
/*
|
||||
* Wait for disco#info exchange to complete.
|
||||
* TODO: Replace with proper wait mechanism (e.g., wait for capabilities
|
||||
* to be cached). Currently we use sleep to ensure disco#info response
|
||||
* is processed before sending /ping command.
|
||||
*/
|
||||
sleep(3);
|
||||
|
||||
// Send ping command - should either work or report server doesn't support it
|
||||
prof_input("/ping");
|
||||
|
||||
prof_timeout(10);
|
||||
// Accept either outcome: ping was sent OR server doesn't support
|
||||
assert_true(prof_output_regex("Ping|Server does not support"));
|
||||
assert_true(prof_output_regex("Pinged server"));
|
||||
prof_timeout_reset();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user