refactor(tests): improve functional test documentation and cleanup

- 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:
2026-01-05 18:29:41 +03:00
parent 730d46da16
commit 8e8d715734
9 changed files with 47 additions and 74 deletions

View File

@@ -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();
}